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 the difference between equals method and ==

Answer Posted / ramanareddy333

equal method compare the the content of the strings,where
as == compares the referance variables .
for example
string s1 = 'ramana'
string s2= ' ramana'
if(s1==s2)
s.o.p("s1, s2 are same");
else
s.o.p(" s1, s2 are not same");

ans = s1,s2 are not same because == compares the referance
variables.

Is This Answer Correct ?    6 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what do you understand by the term string with respect to java?

1101


What is difference between overloading and overriding in java?

1081


Which sorting is best in java?

1043


What is the difference between multitasking and multithreading in Java

1236


What is the list interface in java programming?

1174


Can java hashmap have duplicate keys?

1078


Why we use multi threading instead of multiprocessing?

1123


Why are the destructors for base class and derived class called in reverse order when the program exits

2281


Which collection is best for sorting in java?

1174


What is the java reflection api? Why it’s so important to have?

1028


What is the difference between jdk, jre, and jvm?

1196


what is server side caching?

2238


Can a class with private constructor be extended?

1001


Can you add null to a list java?

1106


Does unicode support all languages?

1087