Bird
0
0

Which statement about Java strings is true?

easy📝 Conceptual Q2 of 15
Java - Strings and String Handling
Which statement about Java strings is true?
AStrings can be modified after creation using methods like append()
BStrings are stored on the stack like primitive types
CStrings do not support comparison using equals() method
DStrings are stored in a special pool to save memory
Step-by-Step Solution
Solution:
  1. Step 1: Recall string storage in Java

    Java stores string literals in a special pool to reuse objects and save memory.
  2. Step 2: Evaluate other options

    Strings are immutable, so no append() method; they are objects stored on the heap; equals() compares content.
  3. Final Answer:

    Strings are stored in a special pool to save memory -> Option D
  4. Quick Check:

    String pool usage [OK]
Quick Trick: String literals reuse memory via the string pool [OK]
Common Mistakes:
  • Confusing strings with mutable objects
  • Thinking strings are stored on the stack
  • Using == instead of equals() for content comparison

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes