This is a question that I got in an interview.
I\'ve two strings defined as
String s1=\"Java\"; String s2=\"Java\";
My question i
Adding to others: new keyword always forces to create a new object. If you declare like below:
String s1 = "some"; String s2 = "some";
Then using String Pooling mechanism, both references s1 and s2 will refer to the same String object with the value "some".