From the javaDocs of String class\'s intern method :
When the intern method is invoked, if the pool already contains a string equal to this String o
seven is the first time you use the string 'hello2'. Therefor what the intern
does is insert your string to the pool (and also return it). there for it is equal to your seven.
when you work with eight, the string is already in the pool (by running seven.intern()
before, therefor when you do eight == eight.intern()
you will get on the left side of the equation the newly created eight
string, and on the right side the string created by seven from the pool, which are not the same