Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- import java.util.Scanner;
- public class Animals {
- public static void main(String[] args) {
- Scanner user = new Scanner(System.in);
- System.out.println(" Here are some animal types! ");
- ArrayList<String> animalTypes = new ArrayList<String>();
- animalTypes.add("Vertebrae");
- animalTypes.add("Reptile");
- animalTypes.add("Insect");
- animalTypes.add("Amphibian");
- System.out.println(" Enter new animal type");
- System.out.println(" Here is your animal types list! ");
- // This for loop is inadequate, I need a while loop as I don't know the exact number of entries from the user//
- for (int index = 0; index < animalTypes.size(); index++) {
- System.out.println(animalTypes.get(index));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement