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

1. An object of a derived class type has exactly one type, the type with which it was declared.

2. If a base class constructor is not called explicitly in the definition of a derived class constructor, an error results.


1. False
Explanation: Object of class type whose class is derived has the “is-a” relationship to classes up the inheritance chain. A derived class has all the variables and member functions of the base class, hence is an object of base class type. It also has the member variables and functions added by its class so it is also an object of the derive class type. As the text says, an HourlyEmployee is also an Employee. Objects of class type whose class type is derived through several derivations have several types.
2. False
Explanation: If a base class constructor is not called explicitly, the default base class constructor is called. We prefer to call base class constructors explicitly.

Computer Science & Information Technology

You might also like to view...

What is the output of the third println statement in the main method?

``` public class Foo { int i; static int s; public static void main(String[] args) { Foo f1 = new Foo(); System.out.println("f1.i is " + f1.i + " f1.s is " + f1.s); Foo f2 = new Foo(); System.out.println("f2.i is " + f2.i + " f2.s is " + f2.s); Foo f3 = new Foo(); System.out.println("f3.i is " + f3.i + " f3.s is " + f3.s); } public Foo() { i++; s++; } }``` a. f3.i is 1 f3.s is 1 b. f3.i is 1 f3.s is 2 c. f3.i is 1 f3.s is 3 d. f3.i is 3 f3.s is 1 e. f3.i is 3 f3.s is 3

Computer Science & Information Technology

How does a concurrent low pause collector work?

What will be an ideal response?

Computer Science & Information Technology

Which command is used to create a duplicate copy of a file, while leaving the original file intact?

A. Save As B. Save C. New Document D. Copy File

Computer Science & Information Technology

A bulleted list is the same as an ordered list.

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

Computer Science & Information Technology