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 does the string method compareto () do?

1009


Can size_t be negative?

1069


What is the difference between inheritance and encapsulation?

1091


Describe the syntax of multiple inheritance? When do we use such an inheritance?

1027


What is final class?

958


Which variable is the independent variable?

924


How do I print a “?

947


What is a class object?

916


What is the benefit of using enum to declare a constant?

1038


What is a default method?

983


Write a program to search a number in the given list of numbers.

991


What is output buffer?

976


Is object a data type?

917


What are the differences between string, stringbuffer and stringbuilder?

966


Is java developer a good career?

962