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 all access modifiers are allowed for top class ?

1187


Differentiate between static and non-static methods in java.

1051


explain autoboxing in java?

1008


What is floor math?

1007


Is java code slower than native code?

1067


define the terminology association.

1104


how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? Or extending thread class or implementing runnable interface. Which is better? : Java thread

1034


How many bytes is a char in java?

1021


Difference between error and exception

6062


What does  mean in regex?

1056


Why do we use bufferedreader?

1009


Explain methods specific to list interface?

985


Which package is always imported by default?

1101


How to connect to a remote database using Applet?

2547


What is the return type of the main method?

1043