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 should I import for arraylist in java?
Is treeset sorted in java?
Explain about method local inner classes or local inner classes in java?
Distinguish between a predicate and a function?
What is byte code and why is it important to java’s use for internet programming?
What does string [] args mean?
How do you implement polymorphism in our day to day life?
What happens if a constructor is declared private?
What are the differences between include directive and include action?
what is meant by encapsulation?
When is the garbage collection used in Java?
What are the different types of garbage collectors in java?
Is string is a keyword in java?
Describe the syntax of multiple inheritance? When do we use such an inheritance?
What is the java virtual machine?