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 difference between “==” and equals()?

Answer Posted / javamasque

“==”: It compares references (memory locations). It does not compares values in the memory location. Hence it is not recommended to find the equality of two objects. It is mostly used to compare primitive types.

equals(): It is used to find the equality of two objects. It actually compares with the values that an object contains.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When can you say a graph to be a tree?

1135


What is the difference between state-based unit testing and interaction-based unit testing?

989


Can a class be declared as static?

1222


What is the declaration statement?

996


What is the difference between C++ and Java and your preferences?

1171


How many techniques can be employed to create a string object?

1172


What is the difference between processes and threads?

1115


How are variables stored?

1033


What is finalize()?

1269


How do you know if a value is nan?

1110


Explain listiterator and methods in listiterator?

1066


What does replaceall do in java?

968


What is the purpose of encapsulation?

1059


Can we sort hashmap in java?

999


What is the major drawback of internal iteration over external iteration?

1079