W3Schools Tryit Editor
[
フレーム
]
Run ❯
Get your
own Java
server
Go to Spaces
Ctrl+Alt+P
enum Level { // Enum constants (each has its own description) LOW("Low level"), MEDIUM("Medium level"), HIGH("High level"); // Field (variable) to store the description text private String description; // Constructor (runs once for each constant above) private Level(String description) { this.description = description; } // Getter method to read the description public String getDescription() { return description; } } public class Main { public static void main(String[] args) { Level myVar = Level.MEDIUM; // Pick one enum constant System.out.println(myVar.getDescription()); // Prints "Medium level" } }
Medium level
AltStyle
によって変換されたページ
(->オリジナル)
/
アドレス:
モード:
デフォルト
音声ブラウザ
ルビ付き
配色反転
文字拡大
モバイル