-
enum을 비교할 때 .equals() 말고 '==' 을 써도 된다.개발/Java 2021. 4. 5. 18:19
stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals
enum은 싱글톤이라 '==' 비교시 제대로 된 결과를 얻을 수 있고, equals() 보다 명확하다는 의견이 있는 것 같다.
stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals
enum은 싱글톤이라 '==' 비교시 제대로 된 결과를 얻을 수 있고, equals() 보다 명확하다는 의견이 있는 것 같다.