Oracle
1Z0-809 · Question #151
1Z0-809 Question #151: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #151. The question stem and answer options stay visible for context.
Question
Given:
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:
- WildAnimal wolf = new WildAnimal("Long");
- WildAnimal tiger = new WildAnimal("Feline", 80, "Short");
- wolf.type = "Canine"; wolf.maxSpeed = 60; wolf.bounds = "Long";
- System.out.println("Canine " + wolf.maxSpeed + " " + wolf.bounds);
- System.out.println("Feline " + tiger.maxSpeed + " " + tiger.bounds);
Options
- AReplace line n2 with: super (type, maxSpeed); this.bounds = bounds;
- BReplace line n2 with: super (type,maxSpeed) ; this.bounds();
- CReplace line n1 with: this.bounds = bounds; super ();
- DReplace line n1 with: this ("Canine",60) ; this.bounds = bounds;
- EReplace line n1 with: super () ; this.bounds = bounds;
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.