Reputation: 1
Is there any need to Override equals() method to used String datatype in Switch case
Upvotes: 0
Views: 204
Reputation: 16450
If your intention is to use String
in your Switch
statement then it's better to use
ENUM TYPE
Upvotes: 1
Reputation: 500743
Not only you don't need to do this, you simply can't (String
is final
).
Upvotes: 3