Bird
0
0

What does it mean that a String in Java is immutable?

easy📝 Conceptual Q11 of 15
Java - Strings and String Handling
What does it mean that a String in Java is immutable?
AOnce created, the string cannot be changed.
BThe string can be changed anytime.
CThe string changes automatically when printed.
DThe string can only be changed inside loops.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the meaning of immutability

    Immutability means the object cannot be changed after creation.
  2. Step 2: Apply this to Java Strings

    Java strings cannot be modified once created; any change creates a new string.
  3. Final Answer:

    Once created, the string cannot be changed. -> Option A
  4. Quick Check:

    String immutability = cannot change after creation [OK]
Quick Trick: Immutable means no change allowed after creation [OK]
Common Mistakes:
  • Thinking strings can be changed directly
  • Confusing immutability with constant variables
  • Assuming strings change when printed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Java Quizzes