Explain the term- Comparing Strings
For comparing Strings never use == operator, use equals method of String class.
- == operator compares addresses (shallow comparison) while equals compares values (deep comparison)
For instance: string1.equals (string2)