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

Explain aggregation in java?

974


Is this valid in java ? Can we instantiate interface in java?

978


What is the name of the java compiler?

1053


What is this keyword used for?

1114


What is java lang string?

980


What do you mean by default constructor in java?

1066


What are byte codes?

1218


What are voids?

962


What is the purpose of the file class in java programming?

1021


What are the four corner stones of oop?

1033


how to run ecllipse with jettyserver for windows environment using batch file

2084


How do you convert an int to a string in java?

1131


Difference between final and effectively final ?

1104


What is the parse method in java?

1118


Why string is not thread safe?

1006