The compiler does special magic with Strings defined at compile time to optimize. Do some research on the String Literal Pool. See post#5
Type: Posts; User: Norm
The compiler does special magic with Strings defined at compile time to optimize. Do some research on the String Literal Pool. See post#5
== compares the values in the variables
equals() compares the values in the objects
String x = "X";
x is a variable that has the address of the object that contains the value: "X"