More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know.
Ans. String class has a public method intern() that returns a canonical representation for the string object. String class privately maintains a pool of strings, where String literals are automatically interned.
these are automatically interned so as to have efficient String comparison using == operator instead of equals which is usually slower.
Help us improve. Please let us know the company, where you were asked this question :