Test your knowledge
Which of the following lines declares an instance method that cannot be overridden in any subclass:
public void talk(): final {
public final void talk() {
public notOverrideable void talk() {
We have an abstract superclass named
Shape
. TheCircle
class is a subclass ofShape
and is a concrete class. If we create an instance ofCircle
namedcircle
, this instance will also be:An instance of
Shape
.A subclass of
Circle
.An abstract superclass of
Circle
.
In UML diagrams, class names that use italic text format indicate that they are:
Concrete classes.
Classes that override at least one member inherited from its superclass.
Abstract classes.
Which of the following lines declares a class that cannot be subclassed:
public final class Dog extends VirtualAnimal {
public final class Dog subclasses VirtualAnimal {
public final Dog subclasses VirtualAnimal {
Which of the following lines declares a concrete class named
Circle
that can be subclassed and whose superclass is theShape
abstract...