Intermediate
Java
Q60 / 100
What does String.intern() do?
Correct! Well done.
Incorrect.
The correct answer is C) Returns a canonical representation from the string pool
C
Correct Answer
Returns a canonical representation from the string pool
Explanation
intern() checks the string pool; if an equal string exists, it returns the pooled reference. This allows == comparison for interned strings.
Progress
60/100