lundi 5 février 2018

How can I use arrays to save at most 20 records?

In this program, I can only use arrays to save at most 20 animal name but there is a error on line 6. The error is The method createAnimalName(String) is undefined for the type of animalDirectory. How can I correct this error?

    public static void storeAnimal() {
         for(int j=0; j<=19; j++) {   ///at most 20 records
         System.out.println("Add animal name:");
         Scanner input = new Scanner (System.in);
         String animalName = input.nextLine();
         createAnimalName(animalName);   /// add the records
 }
 }

Aucun commentaire:

Enregistrer un commentaire