In Java, == means two variables have same value
Box and arrow pictures help:
same value for primitive types is just what you
expect
same value for reference types: arrow points to the same
Object
In Object
public
boolean equals(Object o) {
return this == o;
}
Override equals in class String extends Object to compare Strings character by character (thats what equality for String should mean).