The String.intern() method of Java Strings ensures that all strings contain the same content and share the same memory.
For example, if you have a list of fruits, in which apple occurs 100 times, then with the help of String Interning you can ensure that only one apple is an actually allocated to the memory.
It's an important Java function that helps a lot in saving up the memory space.
For more details, you can refer here: http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#intern()