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

Which graphs are functions?

952


In the below example, what will be the output?

1013


Detail discussions on JVM, memory management and garbage collector.

972


Difference between comparator and comparable in java?

1073


What is static in java?

1069


What is the method to declare member of a class static?

997


What happens if an exception is throws from an object's destructor?

1028


Why use string handling in Java?

1017


What happens when a thread cannot acquire a lock on an object in java programming?

993


Can you give few examples of final classes defined in java api?

991


What is ctrl m character?

1039


what is meant by Byte code concept in Java?

1044


Can you sort a list in java?

965


What is int short for?

1023


Why is flag used in java?

1054