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 difference between calling start() and run() method of thread?

1033


What is string and example?

980


What do you understand by java?

923


What are the differences between abstract class and interface?

988


Why is method overloading not possible by changing the return type in java?

943


How to convert string to char and vice versa?

956


What is stack example?

956


What are the high-level thread states in java programming?

1000


Can a variable be local and static at the same time?

943


Which method must be implemented by all threads?

1194


Is sizeof a keyword in java programming?

1014


What is use of map in java?

949


What do bitwise operators do?

952


What does || || mean in math?

879


Find the value of a specified element of the array arr[i] where 0 <= i <= n-1

923