State the difference between == operator and equals () method.
Advertisements
Question
State the difference between == operator and equals () method.
Distinguish Between
Advertisements
Solution
| S. No. | == operator | equals () |
| 1. | It is a relational operator. | It is a method of string class. |
| 2. | It checks for equality of primitive type of values. | It checks for equality of two string types of values. |
shaalaa.com
Introduction of Operators in Java
Is there an error in this question or solution?
