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



when i write string s1="java"; in one program(application) and string s2="java&q..

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

when i write string s1="java"; in one program(application) and string s2="java&q..

Answer / tj

Yes,They will refer to same memory location..

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More Core Java Interview Questions

What methods are called, When we navigate from one applet to another applet?

1 Answers  


Can interface be private in java?

1 Answers  


Difference between this() and super() ?

1 Answers  


what is difference between excute query ()and execute update ()?

6 Answers   Symphony,


What is the difference between preemptive scheduling and time slicing?

1 Answers  


Which characters are allowed to use as the second character of an identifier, and which characters are not allowed?

2 Answers  


What is e java?

1 Answers  


How to make a non daemon thread as daemon?

1 Answers  


What is Java exception handling?

1 Answers  


Can I import same package/class twice?

1 Answers  


What are green threads in java?

1 Answers  


how cani read a command line argument?(usingfile object).

3 Answers  


Categories