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
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 |
Can we create an object of private class?
Explain role of constructor in a java application?
What is the difference between static (class) method and instance method?
Can this keyword be used to refer static members?
did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???
When should we create our own custom exception classes?
What is the use of java?
What classes of exceptions, caught by a catch clause?
how u do unit testing?
Can a function return a function?
How do you do exponents in java?
int a=1,b=10; System.out.println(a+b--);