Test your knowledge
In Java 9, a subclass:
Inherits all the constructors from its superclass.
Doesn't inherit any constructor from its superclass.
Inherits the constructor with the largest number of arguments from its superclass.
We can declare abstract methods:
In any class.
Only in an abstract class.
Only in a concrete subclass of an abstract class.
A concrete subclass of any abstract class:
Must provide an implementation for all the inherited abstract methods.
Must provide an implementation for all the inherited constructors.
Must provide an implementation for all the inherited abstract fields.
Which of the following lines declare an abstract class named
Dog
as a subclass ofVirtualAnimal
:public abstract class Dog subclasses VirtualAnimal
public abstract Dog subclasses VirtualAnimal
public abstract class Dog extends VirtualAnimal
Which of the following annotations indicated before a method's declaration informs the Java 9 compiler that the method is meant to override the method with the same name...