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 many JVMs can run on a single machine and what is the meaning of Just-In-Time (JIT) compiler?

1546


Does java allow default arguments?

1060


What is instance means in java?

1098


Difference between vector and arraylist.

1186


When we serialize an object does the serialization mechanism saves its references too?

1076


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

1289


Explain the meaning of java applet.

1129


Explain about the main() method in java?

1182


In Java list the methods that can be overridden?

1055


What is a copy constructor in java?

1199


Explain the difference between throw and throws in java?

1062


Can we sort array in java?

1011


Can you change array size in java?

1013


What is string manipulation?

1064


Is nullpointerexception checked or unchecked?

1071