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 meant by tab pans?

859


How can you make a class serializable in java?

776


What does sprintf return?

810


Can you pass by reference in java?

732


What are alternatives to java serialization?

810


What is the benefit of using enum to declare a constant?

863


Define locale.

809


how many types of Inheritance?

930


Explain some best practices you would apply while using collection in java?

813


Why there are some null interface in java? What does it mean?

869


What is return data type?

783


Explain what is encapsulation?

824


What flag up means?

799


Difference between static synchronization vs. Instance synchronization?

826


What is the major advantage of external iteration over internal iteration?

829