No I know that in order to compare a String you have to call its method .equals but how I check if a String is NOT equal to something? Will it be something like if ("hello" != String.equal())?? or is there a special method?
I know I'm being dumb here lol but after some researching I can't find the answer.
two strings are equal in case of equals method if both strings that you are comparing have the same characters and have the same case such as "hello".equals("hello") will return true as both the strings have the same characters h,e,l,l,o and they do have the same length and also have the same case.
Now change the case of h to H i.e write "Hello".equals("hello") this will return false which shows that the strings are not equal.
Use ( ! "hello".equals(someString) ) edit: Yes, same thing striker just posted :)
Thank you VERY MUCH. I didn't find anything on a not equals method for comparing strings. Placing the not operator before the equals test never occured to me. Oh well, such are the pains of beginning programing classes. Thanks again! :):)