String intern()
- 13th Jan 2018
- 0
- 8276
- intern in string with example in java String intern with example in java string intern() method in java when to use string intern() method in java
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, […]