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...

whats the difference between == and .equal ?

Answer Posted / james rajesh

One database tale contain id and name...mostly id's are in int and name's are in String...if u want to compare with id and one number means u use ==
like, if(id==1)
if u want to compare name means u use .equals
like, if(name.equals("Bangalore"))
So point of view,
== used to compare integer
.equals used to compare String

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is a constant variable important?

964


Is binary a low level language?

926


What is a class variable?

1060


What is foreach loop in java?

1027


How do you sort a string in java?

971


Explain about main thread in java?

1093


Can the garbage collection be forced by any means?

1009


When arithmeticexception is thrown?

1042


What access modifiers can be used for variables?

1161


What string is utf8?

1003


what is optional in java 8?

1073


What is class??

1251


Difference between static and dynamic class loading.

1139


Write a program to check for a prime number in java?

1052


When should the method invokelater() be used?

1030