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


Please Help Members By Posting Answers For Below Questions

What is a default constraint?

611


Explain JMS in detail.

613


How to remove the trailing spaces from a string?

650


Is set ordered?

537


What do you mean by Hash Map and Hash Table?

596






What does the string method compareto () do?

535


Differentiate between run time error and syntax error.

567


What is the function of compareto in java?

585


Is node a data type in java?

495


How do you add an arraylist to an array in java?

507


Is java still relevant?

496


what is the major difference between linkedlist and arraylist in java?

549


What is the difference between the size and capacity of a vector?

565


Is java an ide?

523


What is time complexity java?

532