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

What is var keyword ?

1191


What is class array in java?

1064


Can I extend singleton class in java?

1112


What state does a thread enter when it terminates its processing in java programming?

1049


what is thread? What are the high-level thread states? : Java thread

1278


What about abstract classes in java?

1067


What are aggregate functions explain with examples?

1066


What is increment in java?

968


Difference between serialization and deserialization in java?

1148


Why does java not support pointers?

1110


Can we overload the main() method?

1046


What is a JAR file?

1044


What is the difference between the boolean & operator and the && operator in java programming?

1050


Write a program to check string is palindrome without using loop?

1038


How does linkedhashmap work in java?

1026