what is the difference between equals method and ==
Answer Posted / r ramya
== checks the string value
equals for checking the strinhg object
String s1="hai";
String s2=new String("hai");
sop(s1==s2);//false
sop(s1.equals(s2));//true
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a super method?
What is integers and example?
What are the types of sockets in java?
Is array passed by reference in java?
What is difference between float and double?
Why does java does not support multiple inheritance? Explain
What is ‘is-a ‘ relationship in java?
What is extension method in java?
What is an example of procedure?
What are the six ways to use this keyword?
What is the difference between final, finally and finalize()?
What is exception propagation?
What is meant by JVM? Is JVM platform independent or not?
Why hashset is used in java?
What does flag mean in java?