Question: what is canonical representation of string in java?
Answer: The java. lang. String. intern() method returns a canonical representation for the string object. A pool of strings, initially empty, is maintained privately by the class String.