diff --git a/castingandothers/src/main/java/com/example/Main.java b/castingandothers/src/main/java/com/example/Main.java index 6c5fbe2..e92a0f8 100644 --- a/castingandothers/src/main/java/com/example/Main.java +++ b/castingandothers/src/main/java/com/example/Main.java @@ -3,6 +3,11 @@ package com.example; import java.util.Scanner; public class Main { + enum Rank { + SOLDIER, + SERGEANT, + CAPTAIN + } public static void main(String[] args) { System.out.println("Hello world!"); @@ -37,5 +42,32 @@ public class Main { }; c.makesound(); + + //ENUMS + + Rank aa = Rank.SOLDIER; + + switch(aa) { + case SOLDIER: + System.out.println("Soldier says hi!"); + break; + case SERGEANT: + System.out.println("Sergeant says Hello!"); + break; + case CAPTAIN: + System.out.println("Captain says Welcome!"); + break; + } + + // Java API + // The Java API is a collection of classes and interfaces that have been written for you to use. + + // The Java API Documentation with all of the available APIs can be located on the Oracle website at + + // http://docs.oracle.com/javase/7/docs/api/ + + // Once you locate the package you want to use, you need to import it into your code. + + } } \ No newline at end of file diff --git a/castingandothers/target/classes/com/example/Main$1.class b/castingandothers/target/classes/com/example/Main$1.class index 927e7e7..bfcd1db 100644 Binary files a/castingandothers/target/classes/com/example/Main$1.class and b/castingandothers/target/classes/com/example/Main$1.class differ diff --git a/castingandothers/target/classes/com/example/Main$Rank.class b/castingandothers/target/classes/com/example/Main$Rank.class new file mode 100644 index 0000000..b65d7e1 Binary files /dev/null and b/castingandothers/target/classes/com/example/Main$Rank.class differ diff --git a/castingandothers/target/classes/com/example/Main.class b/castingandothers/target/classes/com/example/Main.class index 304f426..4da7236 100644 Binary files a/castingandothers/target/classes/com/example/Main.class and b/castingandothers/target/classes/com/example/Main.class differ