Answer Posted / suman
The == operator works on String object references. If two
String variables point to the same object in memory, the
comparison returns a true result.
The equals method compares the actual char content of two
strings. This method returns true when two String objects
hold char data with the same values.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is string data type?
What is the use of math abs in java?
What does math floor () do?
What class allows you to read objects directly from a stream?
How to split a string in java?
What is the base class of all exception classes in java?
What is the purpose of final keyword and when to use it?
What is a parameter in a function?
Can we call thread start () twice?
Give us the name of the list layoutmanagers in java?
How many bytes is double?
What is the difference between jvm and jre? What is an interface?
What is the covariant return type?
Does treeset use compareto?
Write a java program that prints all the values given at command-line.