System.out.println (bs.equals (new String ("OK"))); } }
1. If you pass a String object then str.equals(obj) will be true if and only if in the above quote you write "OK". 2. Also u can pass only a String object to make the line str.equals(obj) work, passing a BetterString will always return false
He's calling the equals() method on the String object. So passing anything other than a String reference, it will return false.
What you are doing is passing the BetterString object to BetterString's over-ridden equals() method. What Keith Lynn is saying that passing BetterString object to String's equals() method will always return false.