Java: Which statement about String Immutability is the strongest interview answer?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

Which statement about String Immutability is the strongest interview answer?

  1. String Immutability is mostly a naming style choice and has little effect on runtime or design.
  2. String is immutable, which enables safe sharing, caching, and string-pool reuse.
  3. String Immutability exists mainly to reduce the number of Java files in a project.
  4. String Immutability matters only for frontend frameworks, not for core Java applications.

Hint

Start with the core rule behind String Immutability.

Answer and rationale

Correct answer: B. String is immutable, which enables safe sharing, caching, and string-pool reuse.

String is immutable, which enables safe sharing, caching, and string-pool reuse. This is the base concept interviewers commonly test first.

Track: Java