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...

whats the difference between == and .equal ?

Answer Posted / nagaraju

== it is relational operator to copares the values
.equals() is a method to compares the two strings whether
they are equal or not.

if(a==b)
System.out.println("both are equal");


object.equals(string1,string2)
System.out.println("strings are same");

Is This Answer Correct ?    24 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by scope of variable?

892


Can constructor be inherited?

1036


Why string is not thread safe?

1008


What is mean by encoding?

1080


What is casting in java programming?

1032


What is double in java?

987


Is it possible to write a regular expression to check if string is a number?

1028


Explain about the interpreter in java?

1057


How many inner classes can a class have?

1045


What is prefix of a string?

1041


Explain about join() method?

968


What is a subsequence of a string?

1068


Java is Pass by Value or Pass by Reference?

1045


What is the java project architecture?

2244


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

968