Skip to content
ADevGuide Logo ADevGuide
Go back

Java String Quiz: 16 MCQ Questions with Answers

Updated:

By Pratik Bhuite | 7 min read

Hub: Java / Interview Fundamentals

Series: Java Interview & Problem Solving Series

Last updated: Mar 26, 2026

Part 10 of 11 in the Java Interview & Problem Solving Series

Key Takeaways

On this page
Reading Comfort:

Java String Quiz: 16 MCQ Questions with Answers

Java String Quiz Questions

This Java String quiz helps you revise core interview topics like String immutability, the string constant pool, StringBuilder, and StringBuffer. It mixes conceptual and code-based MCQs so you can quickly test whether your fundamentals are solid.

Java String Wrapper Class Quiz Important Multiple Choice Questions

1. Which of the below method of the String class can be used to test string equality?

A) equals()
B) isEqual()
C) isequals()
D) equal()

Answer

A

2. Which of the below method of String class is used to obtain character at specified index?

A) char()
B) Charat()
C) charAt()
D) CharacterAt()

Answer

C

3. What is the full form of Java String SCP?

A) String Collection Pool
B) String Constant Pool
C) String Common Pool
D) String Count Pool

Answer

B

4. Which of the below method of the String class can be used to find the total number of characters in the String?

A) chars()
B) size()
C) len()
D) length()

Answer

D

Java Regex Quiz: 20 MCQ Questions with Answers

String s = new String(“PraBhu”); String p = new String(“PraBhu”); System.out.println(s == p);

A) true
B) false

Answer

B

6. Choose the correct output of the below code about String – Character Equality?

Character c = ‘A’; String s = “A”; System.out.println(c.equals(s));

A) true
B) false

Answer

B

7. Choose the correct output of the below code about the String value equality?

String s = new String(“ADevGuide”); String p = new String(“ADevguide”); System.out.println(s.equals(p));

A) true
B) false

Answer

A

8. Choose the correct output of the below code about String addition?

String s1 = “ADev”; String s2 = “Guide”; String s3 = s1 + s2; String s4 = “ADevGuide”; System.out.println(s4 == s3);

A) true
B) false

Answer

B

9. Choose the correct output of the below code about String compile-time addition?

String s1 = “ADev”; String s2 = “Guide”; String s3 = “ADev” + “Guide”; String s4 = “ADevGuide”; System.out.println(s4 == s3);

A) true
B) false

Answer

A

10. Choose the correct output of the below code?

String s1 = “ADev”; String s2 = “Guide”; String s3 = s1 + “Guide”; String s4 = “ADevGuide”; System.out.println(s4 == s3);

A) true
B) false

Answer

B

11. Choose the correct output of the below code?

String s1 = new String(“ADevGuide”); String s2 = s1.intern(); String s3 = “ADevGuide”; System.out.println(s1 == s2); System.out.println(s2 == s3);

A) true false
B) true true
C) false false
D) false true

Answer

D

12. Is the below statement true about the SCP and Garbage Collector?

Garbage Collector is not allowed to access SCP. SCP is destroyed only on JVM Shutdown.

A) True
B) False

Answer

A

13. Choose the correct output of the below code about String default value?

String s1 = new String(); System.out.println(s1 == null); System.out.println(s1 == "");

A) true false
B) true true
C) false false
D) false true

Answer

C    ; **Explaination:**  s1.intern()==”” will be true.

14. Choose the correct output of the below code about String Builder?

String s1 = “ADevGuide”; StringBuilder sb1 = new StringBuilder(“ADevGuide”); System.out.println(sb1.equals(s1));

A) true
B) false

Answer

B

15. Choose the correct output of the below code about String Builder equality?

StringBuilder sb1 = new StringBuilder(“ADevGuide”); StringBuilder sb2= new StringBuilder(“ADevGuide”); System.out.println(sb1.equals(sb2));

A) true
B) false

Answer

B

16. Choose the correct output of the below code about String Builder-String equality?

String s1 = “ADevGuide”; StringBuilder sb1 = new StringBuilder(“ADevGuide”); StringBuilder sb2= new StringBuilder(s1); System.out.println(sb1.equals(sb2));

A) true
B) false

Answer

B

To Learn More:

Oracle String

That’s all from now, we will keep adding more questions to the “Java String Wrapper Class Quiz”. If you have any questions, drop us a comment below.


Share this post on:

Next in Series

Continue through the Java Interview & Problem Solving Series with the next recommended article.

Related Posts

Keep Learning with New Posts

Subscribe through RSS and follow the project to get new series updates.

Was this guide helpful?

Share detailed feedback

Previous Post
How JWT Works: Step-by-Step Guide for Beginners
Next Post
Reverse Integer in Java: Simple Explanation and Code