Answer the following statements true (T) or false (F)

1. A base class's constructors are inherited into its derived classes.
2. The first task of any base class’s constructor is to call its derived class’s constructor.
3. To call the base-class default constructor explicitly, the call to a base-class constructor must be the first statement in the derived-class-constructor definition.
4. When you call an Overridable base class method on a derived class object, the base class version of the method executes. This is the basis of polymorphism.
5. When a program creates a derived-class object, the Object constructor is the last constructor called and the first whose body finishes executing.

1. False. Constructors are never inherited—they are specific to the class in which they are declared
2. False. The first task of any derived class’s constructor is to call its base class’s constructor.
3. True.
4. False. When you call an Overridable base class method on a derived class object, the derived class version of the method executes. This is the basis of polymorphism.
5. True.

Computer Science & Information Technology

You might also like to view...

Attackers perform vulnerability analysis to identify security loopholes in the target organization's policies and procedures.

a. true b. false

Computer Science & Information Technology

What does the tag

cause to happen?

A) A double space B) A paragraph break C) Indentation for a paragraph D) Plain text to be displayed

Computer Science & Information Technology