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
What is purpose of applet programming?
Which of the following is not an isolation level in the JDBC
Is array an object in java?
What does percent mean in java?
What is the use of hashmap in java?
Can we access instance variables within static methods ?
How do you create a bulleted list?
What is formatted output?
What is a conditional statement explain with example?
Can constructor be protected in java?
Can we define static methods inside interface?
What is composition in java?
What is Applet Stub Interface ?
What is return null in java?
This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }