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.
Answers were Sorted based on User's Feedback
Answer / 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 |
What is the purpose of the enableevents() method?
What is the life cycle of Servlet?
What are the limitations for static method?
Why we override equals() method?
What does this () mean in java?
What are static initalizers in java ?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
Why does java does not support multiple inheritance? Explain
why Java does not support multiple inheritances?
How to make a write-only class in java?
can we have function for truncating the sign as like abs in oracle.
What is ‘is-a ‘ relationship in java?