Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Give the difference between the println method and sqrt method?

1076


What is palindrome in java?

963


how to write a program for sending mails between client and server

2057


What is the ==?

872


Explain the pointers in Java?

1035


What is empty list in java?

1061


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1052


What are aggregate functions explain with examples?

1044


Is java still necessary?

1031


what is the constructor and how many types of constructors are used in java?

987


Can we have multiple classes in a single file?

952


How to split arraylist elements in java?

1147


What does it mean that a class or member is final?

980


What is string pooling concept?

1050


What is difference between next () and nextline () in java?

978