Question: Question 1 The class that does the inheriting is referred to as parent class or base class or super class. True False Question 2 Methods
Question 1
The class that does the inheriting is referred to as parent class or base class or super class.
| True | |
| False |
Question 2
Methods inherited from the base/super class can be overridden. This means changing their implementation; the original source code from the base class is ignored and new code takes its place. Abstract methods must be overridden.
| True | |
| False |
Question 3
When inheriting a class, our constructors must call the base class constructor, so that it can initialize its member variables. If not done explicitly, the compiler will place a call to the parameterless/default base class constructor
| True | |
| False |
Question 4
Protected defines class members which are not visible to users of the class (those who initialize and use it), but are visible to all inheriting classes (descendants).
| True | |
| False |
Question 5
An interface can only declare methods, variables and constants.
| True | |
| False |
Question 6
The class that implements a certain interface must implement all methods in it. The only exception is when the class is abstract.
| True | |
| False |
Question 7
Polymorphism can bear strong resemblance to abstraction, but it is mostly related to overriding methods in derived classes, in order to change their original behavior inherited from the parent class.
| True | |
| False |
Question 8
Each class with at least one abstract method must be abstract. However, the opposite is not true. It is possible to define a class as an abstract one, even when there are no abstract methods in it.
| True | |
| False |
Question 9
Abstract classes and interfaces cannot be instantiated:
| True | |
| False |
Question 10
A subclass should be created when we expect the class to change/complement / alter some of the parent class' functionality.
| True | |
| False |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
