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

Are maps ordered java?

898


Is the empty set a singleton?

912


How many types of gc are there in java?

935


What is thread safe in java?

940


What does a boolean method return?

1153


Are global variables initialized to zero?

912


What are predicates in java 8?

972


Mention some interfaces implemented by linked list in java.

976


What is the use of predicate in java 8?

894


What are three advantages of using functions?

957


Why does java doesnt suuport unsigned values?

2177


How do you input a string in java?

998


What does exclamation mean in java?

1019


What is string immutability?

1027


How does varargs work in java?

1040