1Z0-829 • Practice Test 4 — 25 Questions
Free 1Z0-829 practice test 4 — 25 questions with explanations. No signup required.
Refer to the exhibit. What is the result of compiling and running the Main class?
// File: com/example/animals/Dog.java
package com.example.animals;
public class Dog extends Animal {
public void bark() {
System.out.println("Woof");
}
}
// File: com/example/animals/Animal.java
package com.example.animals;
public class Animal {
protected void makeSound() {
System.out.println("Some sound");
}
}
// File: com/example/test/Main.java
package com.example.test;
import com.example.animals.Dog;
public class Main {
public static void main(String[] args) {
Dog dog = new Dog();
dog.makeSound(); // Line 8
}
}