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 is the difference between equals method and ==

Answer Posted / subrahmanyam

== is userd to compare both are of same type
equals is used to compare both are of same contents


EX:
String s1="raju";
String s2=new String("raju");
if(s1.equals(s2))
System.out.println(" if(s1.equals(s2)"); //true
if(s1==s2)
System.out.println(" s1==s2"); //false

Is This Answer Correct ?    62 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is cr keyboard?

1270


Are constructors methods?

1029


What do you mean by constant time complexity?

1257


Does list maintain insertion order java?

928


Can a class be a super class and a sub-class at the same time? Give example.

1576


Difference between linkedlist and arraylist.

1082


When should you use arraylist and when should you use linkedlist?

936


What is the difference between this() and super() in java?

1054


Is minecraft 1.15 out?

983


what is thread? : Java thread

991


Why collection is called framework in java?

996


How to retrieve data from database in java using arraylist?

1059


Can we cast any other type to boolean type with type casting?

962


What is a void method java?

966


What is difference between wait and notify in java?

1149