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 default constraint?
Explain JMS in detail.
How to remove the trailing spaces from a string?
Is set ordered?
What do you mean by Hash Map and Hash Table?
What does the string method compareto () do?
Differentiate between run time error and syntax error.
What is the function of compareto in java?
Is node a data type in java?
How do you add an arraylist to an array in java?
Is java still relevant?
what is the major difference between linkedlist and arraylist in java?
What is the difference between the size and capacity of a vector?
Is java an ide?
What is time complexity java?