when i write
string s1="java";
in one program(application) and
string s2="java";
in another application
on the same jvm will both objects s2,s2 will refer to same
memory location where "java" is stored
in string pool.
Answer Posted / ss
String s1="java";
String s2="java";
System.out.println(s1.equals(s2)); -->true
System.out.println(s1==s2); --->true
| Is This Answer Correct ? | 6 Yes | 3 No |
Post New Answer View All Answers
What is a condition in programming?
Why java is not 100% object-oriented?
do I need to use synchronized on setvalue(int)? : Java thread
What does the exclamation mark mean in java?
Java is Pass by Value or Pass by Reference?
Do loops java?
What do you understand by the term string pool?
Why is java not 100% pure oops?
What is string subsequence method?
What is the difference between static class and normal class?
What is scope & storage allocation of static, local and register variables? Explain with an example.
Difference between string s= new string (); and string s = "abv";?
What is the use of :: in java?
What is implicit object in java?
what do you understand by synchronization? : Java thread