Ohh.. i see.. sorry
The problem here is with the equals() method. The String class overrides the equals() method from Object, so when you do this:
Test is not overriding equals, so
The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any reference values x and y, this method returns true if and only if x and y refer to the same object (x==y has the value true).
http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Object.html#equals This is the main reason it returns false.
Now, String class overrides equals, so when you do equals() it returns true.
String and wrapper classes override equals to check for values.
From KnB book.
I hope this helps. let me know
[ July 29, 2003: Message edited by: Andres Gonzalez ]