@@ -0,0 +1,726 @@
+// Use an enum constructor, instance variable, and method.%0Aenum Transport %7B%0A%09CAR(65), TRUCK(55), AIRPLANE(600), TRAIN(70), BOAT(22);%0A%09%0A%09private int speed; // typical speed of each transport%0A%09%0A%09// Constructor%0A%09Transport(int s) %7B speed = s; %7D%0A%09%0A%09int getSpeed() %7B return speed; %7D%0A%7D%0A%0Aclass EnumDemo3 %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09Transport tp;%0A%09%09// Display speed of an airplane.%0A%09%09System.out.println(%22Typical speed for an airplane is %22 + Transport.AIRPLANE.getSpeed() + %22 miles per hour.%5Cn%22);%0A%09%09%0A%09%09// Display all Transports and speeds.%0A%09%09System.out.println(%22All Transport speeds: %22);%0A%09%09for(Transport t : Transport.values())%0A%09%09%09System.out.println(t + %22 typical speed is %22 + t.getSpeed() + %22 miles per hour.%22);%0A%09%7D%0A%7D%0A

Use an enum constructor, instance variable, and method