Defining an abstract class Flashcards
Give a characteristic of abstract classes !
A characteristic if an abstract class is that it is not required to include any abstract methods
Give a characteristic of abstract methods !
An abstract method can only be defined in an abstract class or an interface
Give a pitfall of abstract methods !
Abstract methods for which a body is provided don’t compile
Can an abstract class contain non abstract methods ?
An abstract class can contain non abstract methods
Give one criteria that the declaration of an abstract class has to satisfy in order to not have a compilation error ?
An abstract class can not be declared as final because an abstract class is by definition a class that must be extended to be instantiated
Same question for an abstract method!
An abstract can not be declared as final because by definition an abstract method must be overridden
An abstract method can not be declared as private because by definition an abstract method must be overridden
Give a second criteria that the declaration of an abstract method has to satisfy on order to not have a compilation error ?
An abstract method can not be declared as private because by definition an abstract method must be overridden