The java string intern() method returns the
interned string. It returns the canonical representation of string. It can be
used to return string from pool memory, if it is created by new keyword.
public String intern()
Example:
public String intern()
Example:
Advantage: To get the reference of String constant pool object
No comments:
Post a Comment