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
What do you mean by pointer value and address?
Can you extend main method in java?
What is jvm? Why is java called the platform independent programming language?
What is meant by flickering?
What is singleton class and how can we make a class singleton?
What is nested top-level class?
Objects or references which of them gets garbage collected?
What is the difference between static class and normal class?
How do you use compareto?
How do you calculate roots in java?
What is JDBC Driver interface?How can you retrieve data from the ResultSet
What is an array in java?
What is the different types of functions?
What restrictions are placed on method overloading?
What are the different types of inner classes?