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 is an array in java?
How many types of gc are there in java?
What is java util list?
Is assembly language a low level language?
Why does java have different data types for integers and floating-point values?
What is an empirical question?
is it possible to instantiate the math class?
What do you mean by constant time complexity?
How we can execute any code even before main method?
How to convert string to char and vice versa?
Explain the difference between private, public, package and protected in java?
What does index mean in java?
What is the null?
Explain about the main() method in java?
Is string is a class in java?