Java SE 8 Programmer 1Z0–808 Practice Full Test 1

© examsiri.com
Question : 57 of 84
 
Marks: +1, -0
class Animal {
   String type ="Canine";
   int maxSpeed = 60;

   Animal() {}

   Animal(String type, int maxSpeed) {
      this.type = type;
      this.maxSpeed = maxSpeed;
   }
}

class WildAnimal extends Animal {
   String bounds;

   WildAnimal(String bounds) {
      // line n1
   }

   WildAnimal(String type, int maxSpeed, String bounds) {
      // line n2
   }
}

//And given the code fragment:

7. WildAnimal wolf = new WildAnimal ("Long");
8. WildAnimal tiger = new WildAnimal ("Feline", 80, "Short");
9. System.out.println (wolf.type + " " + wolf.maxSpeed + " " +wolf.bounds);
10. System.out.println (tiger.type + " " + tiger.maxSpeed + " "+ tiger.bounds);

Which two modifications enable the code to print the following output? (Choose two.)
Canine 60 Long
Feline 80 Short
Go to Question: