When should we use intern method of String on String literals
According to String#intern(), intern method is supposed to return the String from the String pool if the String is found in String pool, otherwise a new string object will be added in String pool and the reference of this String is returned. So i tried this: String s1 = “Rakesh”; String s2 = “Rakesh”; String … Read more