public class MyClass
{
public static void main(
String args[])
{
Object obj1= "SCJP" ;
Object obj2 = new String("SCJP");
System.out.println(obj1.equals(obj2));
}
}
In this code it prints out true when i supposed it should print false.
if we change the string matter in obj1 then it prints out false.
Why should the compiler relate it to the Strings. What i think it is supposed to be just compare based on references ie Object.Plase help me.