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()?



What is difference between “==” and equals()?..

Answer / 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

More Core Java Interview Questions

Can we override tostring method in java?

0 Answers  


int a=1; float b=1.0; System.out.println(a==b);

13 Answers   CTS, Honeywell, McAfee,


What is the difference between a local variable and an instance variable?

0 Answers  


How use .contains in java?

0 Answers  


"We cannot create an object of interface but we can create a variable of it". Discuss the statement with the help of an example. (Plz help us to provide immediately.)

3 Answers  


What type of variable is gender?

0 Answers  


What is the generic function?

0 Answers  


What is the difference between Error, defect,fault, failure and mistake?

0 Answers   HCL,


What are the types of strings?

0 Answers  


Can a hashset contain duplicates java?

0 Answers  


What are the types of statement? explain

1 Answers   SysBiz,


What happens when I use / and % with a negative numerator?

0 Answers  


Categories