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

How do you start a thread?

792


Explain the difference between abstraction and encapsulation.

757


Explain different types of thread priorities ?

877


Is overriding possible in java?

726


What is the use of static class?

805


What is the purpose of assert keyword used in jdk1.4.x?

781


What are the main differences between the java platform and other platforms?

788


Why unicode is important?

692


What is the use of singleton class?

743


What is assembly used for?

797


What is the difference between the font and fontmetrics classes in java programming?

735


What is boolean example?

755


How does multithreading take place on a computer with a single cpu?

793


How do you sing an Applet ?

2260


Why constructor has no return type?

872