Last active
December 15, 2019 05:53
-
-
Save Nekoyuki/90a212e1bffb4b636a3b04ded5a7b028 to your computer and use it in GitHub Desktop.
java/ enum behavior check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Main { | |
public enum Enum_sample{ | |
HAGE, | |
HIGE, | |
HOGE; | |
} | |
public static void main(String[] args) throws Exception { | |
// Your code here! | |
System.out.println(Enum_sample.HAGE); | |
System.out.println(Enum_sample.HAGE.name()); | |
System.out.println(Enum_sample.valueOf("HAGE")); | |
System.out.println(Enum_sample.HAGE.toString()); | |
System.out.println(Enum_sample.HAGE.getClass()); | |
System.out.println(Enum_sample.HAGE.hashCode()); | |
for(Enum_sample e : Enum_sample.values()) { | |
System.out.println(e); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment