This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
String s = new String("Java"); ------If this means the same as following: String s = new String();//A String got created in non-pool memory! s = "java"; // A string "java" created in pool memory!
All are saying that the above line creates two objects. One object is "JAVA" referred by 's' and what is the other object and reference variable to refer it. thanks
Abhijit Das
SCJP 5.0 | SCWCD 1.5
Nadeem Khan
Ranch Hand
Joined: Nov 27, 2007
Posts: 108
posted
0
String s = new String("JAVA");
What i inferred from K & B, it creates two objects - "java" in pool memory and another object (new String()) in non-pool.And s points to "java".
Can someone please explain the relation between these two objects getting created here?
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.