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
Can java list be null?
What is unicode used for?
List the interfaces which extends collection interface?
How do you read a char in java?
What are the types of java?
How long will it take to learn java?
Why is java multithreaded?
What is java objectoutputstream?
What is java abstraction with example?
Implement a stack with push (), pop() and min() in O(1) time.
How does the java compiler work?
Can we extend singleton class in java?
why are wait(), notify() and notifyall() methods defined in the object class? : Java thread
Is char a method in java?
What is stringwriter?