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 purpose of applet programming?

1237


Which of the following is not an isolation level in the JDBC

2182


Is array an object in java?

1020


What does percent mean in java?

1075


What is the use of hashmap in java?

1134


Can we access instance variables within static methods ?

1152


How do you create a bulleted list?

1308


What is formatted output?

1018


What is a conditional statement explain with example?

1064


Can constructor be protected in java?

1021


Can we define static methods inside interface?

1030


What is composition in java?

1340


What is Applet Stub Interface ?

2563


What is return null in java?

1021


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

1043