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

Define max and min heap, also the search time of heap.

1034


What is currentthread()?

1013


What is package protected in java?

1000


What is foreach loop in java?

1030


Explain methods specific to list interface?

994


How can you make a class serializable in java?

1004


What are namespaces in java?

1050


Is ++ operator thread-safe in java?

1200


What is the use of using enum to declare a constant?

1040


How does finally block differ from finalize() method?

1063


Is null a keyword in java?

980


What is an iterator java?

1128


What is a native method in java programming?

1083


What is a flag and how does it work?

1022


Does java map allow duplicates?

910