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 / y.v.v.d.ravikanth

equals() method is from Object Class.So this is the method
to check the equality between two objects.This method
implements the equalence relation.

ex obj1 o1 = "ravi";
obj2 o2 = "ravi";

o1.equals(o2) ;// returns true.

== Operator. no doubt this is the operator. It can be used
in two ways
1:To compare the values of primitive variables.
2.To compare the object refference variables.
it returns true if refference variable reffering to the
same object.

ex obj1 a
obj2 b
obj1 c

a==c----> returns true.
a==b----> returns false.

Is This Answer Correct ?    17 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why does java not allow multiple public classes in a java file ?

4487


What is function overriding and overloading in java?

1101


Can this keyword be used to refer static members?

1014


Explain about exception propagation?

1013


What is method with example?

1096


Why is whitespace important?

1069


Why we use multi threading instead of multiprocessing?

1049


What is the purpose of format function?

1140


What is string english?

995


When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

1045


Does java arraylist maintain insertion order?

972


What is the purpose of using java.lang.class class?

997


What are the types of literals?

1152


Does a class inherit the constructors of its superclass in java programming?

1083


What is the r character?

997