class a{
int x;
void printthis(){
System.out.println("In calss a.");
}
}
class example52{
public static void main(String args[]){
a b=new a();
//b.x=1;
a c=new a();
b.x=1;
c.x=1;
String str=b.toString();
System.out.println(str+" "+b.equals(c));
}
}
the result of executing the above code is
a@9304b1 false
what does the first part of the result mean and why is the equals method returning false when both the objects b and c have been initialised to the same value?


Sign In
Create Account


Back to top









