String intern()

Intern() method available in String class is used to return the string from the String constant pool. This will reduce the problem of string duplicates in Java. Whenever we call intern() method of String on any string object, it first checks whether same string is already available in string pool. If it’s available in pool, […]

Share this article on