uebungen/sources/beispieleVL/enumeration/Main.java

22 lines
575 B
Java

package enumeration;
public class Main {
public static void main(String[] args) {
System.out.println(Planet.values());
for (Planet planet : Planet.values()) {
System.out.printf("%s -> %,.0f km/h%n",
planet.name(),
planet.bahngeschwindigkeit());
}
System.out.println(Planet.MERKUR.toString());
System.out.println(Planet.MERKUR.name());
System.out.println(Planet.JUPITER.toString());
System.out.println(Planet.JUPITER.name());
}
}