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 method is used to compare two strings ?

Answer Posted / interviewall

If string a="aaaa"; and String b="bbbb";
we can compare them as
if(a.equals(b)) and get a boolean as a return type.

////////////////////////////////////////////////////////

We can also compare String as
a.compareTo("aaaa"); which gives 0 as output as they are
equal.

Is This Answer Correct ?    6 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of a parameter?

1135


Can we write multiple catch blocks under single try block?

1142


Can we increase size of array?

1069


Does importing a package imports its sub-packages as well in java?

1014


Why do we use bufferedreader?

1051


Which is illegal identifier in java?

1138


What does a za z0 9 mean?

1183


Can we make constructors static?

1285


How to declare an arraylist in java?

1192


Is string an object?

1167


Can we override data members in java?

1193


Can you access non static variable in static context?

1098


How does class forname work in java?

1023


What is the gregoriancalendar class in java programming?

1090


what is the final keyword denotes in java?

1157