Commit 472df628 authored by sam.pople's avatar sam.pople

update

parent 273755cc
No preview for this file type
...@@ -2,7 +2,6 @@ import java.util.ArrayList; ...@@ -2,7 +2,6 @@ import java.util.ArrayList;
import java.util.Scanner; import java.util.Scanner;
public class App { public class App {
public static void app(String[] args) { public static void app(String[] args) {
Scanner sc = new Scanner(System.in);
ArrayList<Animals> Animals = new ArrayList<Animals>(); ArrayList<Animals> Animals = new ArrayList<Animals>();
// Mammals // Mammals
...@@ -70,5 +69,17 @@ public class App { ...@@ -70,5 +69,17 @@ public class App {
Clownfish.Environment = new Marine("Sheltered reefs", "They live in anemones in warm reefs", "Pacific Ocean", 24, 3); Clownfish.Environment = new Marine("Sheltered reefs", "They live in anemones in warm reefs", "Pacific Ocean", 24, 3);
Animals.add(Clownfish); Animals.add(Clownfish);
Scanner sc = new Scanner(System.in);
System.out.print("Enter code:");
String str = sc.next();
if (str == "999"){
System.out.println("Animals: ");
for (int i = 0; i < Animals.size(); i++) {
System.out.println(Animals.get(i));
} }
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment