what is the difference between equals method and ==
Answer Posted / rajender
The Object class equals method refers address comparision.
Person p=new Person();
Person p1=new Person();
if(p.equals(p1){
//is always false.
}
the string class equals method refers content comparision
String p=new String ("java");
String p1=new String ("java");
if(p.equals(p1){
//is always true.
}
Dn't get confusion
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is the applet security manager, and what does it provide?
What is binary tree in java?
When we should use serialization?
How will you communicate between two applets?
How many types of gc are there in java?
What is protected in java?
What type of value does sizeof return?
What does yield method of the thread class do?
How do you use find and replace?
How many digits can a float hold?
Whats the difference between notify() and notifyall()?
Write a program to reverse array in place?
What is reverse function?
Is string is a class in java?
What is application tier?