Java Enum equals() MethodThe equals() method of Enum class returns true if this enum object is same as the defined object. SyntaxOverrideThe equals() method of Enum class overrides the equals() method of class Object. Parametersother -It is the object to be compared with this enum. Return ValueThe equals() method returns true if the defined object is equal to this enum. Example 1Output: red and reD are not equal because of case sensitivity Example 2Output: Choose amongst the following: Stone Paper Scissor # Example 3Output: Q In which movie Shah rukh khan has played a dual role ? Ans. Don Your answer is correct. Next TopicJava-enum-finalize-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India