You should not use ==
because it does something else than you think.
In this case, "hello" is saved ("Reading at the boarding line"), so "matching" means that it is the same as your "insanity."
==
checks if two things are EXACTLY the same thing, and not if they have the same content. This is really a big difference, and some random (albeit explicable) “false possibilities” are not grounds for using this method.
Just use equals to compare strings.
An example is provided on this site: http://blog.enrii.com/2006/03/15/java-string-equality-common-mistake/
String a = new String ("a"); String b = new String ("a"); System.out.println (a == b);
It returns false, and the following code returns true.
String a = new String ("a"); String b = new String ("a"); System.out.println (a.equals(b));
source share