Possible Duplicate:
Questions about Java's String pool
Guys what is the difference between these two.
(1)
String s = new String("hello"); // creating an object on heap then assign that object to the reference s.
(2)
String s = "hello" // did I make an object here?? Im not using the word new.
Also array example
int x[] = {1, 2, 3, 4, 5}; // did I make object here?