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

How many classes can any class inherit java?

973


What about static nested classes in java?

1152


How to sort a collection of custom Objects in Java?

1061


What is hashmap in java?

1064


Can memory leak in java?

1042


What is the scope or life time of instance variables?

1120


What does int argc char * argv [] mean?

999


What is compareto?

1042


How are this() and super() used with constructors in java programming?

1067


Can we overload the main() method?

1051


Is map ordered in java?

953


Can an interface extend another interface?

1063


What is a java string?

1092


Write a program based on Java script program.

1149


Can you pass by reference in java?

985