Question: 1.Inheritance reduces program development time by making it harder for other programmers to exactly know what to do. True/False. 2.In a 'has-a' relationship, an object
1.Inheritance reduces program development time by making it harder for other programmers to exactly know what to do. True/False.
2.In a 'has-a' relationship, an object of a subclass can be tread as an object of its superclass. True/False
3.A superclass's ------- members can be accessed directly only within the superclass declaration.
-private
-protected
-public-
-package
4.The only way to access superclass's private members is through the public methods, or protected methods inherited from the superclass. True/False
5.A subclass can access any member of its superclass except private members. True/False
6.When an object of a subclass is instantiated, a superclass's ------- is called (invoked) implicitly or explicitly.
7.Subclass constructors can call superclass constructors via the ------ keyword.
8.Suppose class A inherits from class B which has a subclass C, and class D inherits from class C.
Answer the following.
-What is the order of "calling (invoking) constructors" when an object of class A is instantiated?
-What is the order of "calling (invoking) constructors" when an object of class D is instantiated?
NOTED: Q8 asks about constructor invocation and not the execution of the constructor body.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
