why do we use equals method in java code example Example: java equal method if(bob.equals("Sam")){ // Checks if strings are equal. // code }