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 difference between local variable and global variable?

1018


Can bool be null?

986


How dead lock situation occurs in java and how you can identify it?

996


What are the main uses of this keyword?

1063


Is it possible to compare various strings with the help of == operator? What are the risks involved?

1072


What is difference between == equals () and compareto () method?

1049


What is mean by collections in java?

1180


What is a flag value?

1026


How does multithreading take place on a computer with a single cpu in java programming?

1015


What’s a deadlock?

1102


Why java strings are immutable in nature?

1071


What was java originally called?

955


What is the difference between a choice and a list?

1079


What is the program development process?

973


What 5 doubled?

986