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

Is a class an object?

986


What is a parameter in matrices?

1032


Explain the pointers in Java?

1036


What does  mean in regex?

1037


What do you mean by static variable?

1055


What is final int?

1005


Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)

1319


What is empty list in java?

1062


How many types of interfaces are there?

1044


What two classes are used to read data only?

1077


What is treeset in java?

977


What is variable length arguments in java?

948


How many bytes is string in java?

1222


What is string pool in java?

1008


How static variable work in java?

1103