Possible Duplicate:
Why are these == but notequals()?
I know in Java, “==” is used to compared reference not values while “equals” to is used to compare values.
Then if
int a=100;
int b=100;
boolean c=(a==b);
Then c will be false? But I remember in my previous project, it seems to be true….
c is true, because you’re comparing primitives, not references. == compares primitives by value (since the value is all you’ve got).