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

How to sort array of 0 and 1 in java?

895


What is jee6?

1009


What is a layout manager and what are different types of layout managers available in java awt?

1194


What is a methodologist?

991


Which of the following classes will have more memory allocated?

970


What is java regex?

938


What is the difference between an if statement and a switch statement?

1098


What means public static?

991


How does enum work in java?

960


Is it possible to write a regular expression to check if string is a number?

969


What is string in java is it a data type?

947


How many bits is a word?

951


How do you remove duplicates in java?

953


What is variable argument in java?

947


What is a cup of java?

975