I'm studying about String in Java and I wonder, what is difference between:
String hello = "Hello Java";
System.out.println(hello);
and only use this:
System.out.println("Hello Java");
Are they the same ? Both go in string pool ? Thanks !
Second example:
if("dog" == "cat")
return true;
Are this literals stored in java memory ? If they are store what are the references?