Exam 11: Object-Oriented Programming: Inheritance

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

A class that inherits from another class is referred to as the derived class.

(True/False)
4.7/5
(32)

Consider the classes below,declared in the same file: Class A { Int a; Public A() { A = 7; } } Class B : A { Int b; Public B() { B = 8; } } Which of the statements below is false

(Multiple Choice)
4.8/5
(34)

Every class in C#,except __________,extends an existing class.

(Multiple Choice)
4.8/5
(46)

Which base class members are inherited by all derived classes of that base class

(Multiple Choice)
4.8/5
(29)

All classes in C# have object as either a direct or indirect base class.

(True/False)
4.8/5
(30)

Derived classes provide the functionality and features inherited by base classes.

(True/False)
4.7/5
(35)

Using protected instance variables can cause derived-class methods to be written to depend on base-class implementation.

(True/False)
4.9/5
(35)

A class inherited from two or more levels up in the hierarchy is known as a

(Multiple Choice)
5.0/5
(37)

Which of the following statements is (are)true A.We can use inheritance to customize existing software. B.A base class specifies commonality. C.A base class can be modified without modifying derived classes D.A derived class can be modified without modifying its derived class.

(Multiple Choice)
4.9/5
(32)

When a derived-class member overrides a base-class member,the base-class member can be accessed from the derived-class by using the keyword

(Multiple Choice)
4.8/5
(34)

Members of a base class that are private are not inherited by derived classes.

(True/False)
4.9/5
(47)

Which of the following pairs demonstrates the has-a relationship between the first and the second terms

(Multiple Choice)
4.9/5
(33)

Overriding a method differs from overloading a constructor because:

(Multiple Choice)
4.8/5
(31)

Which of the following pairs demonstrates the is-a relationship between the first and the second terms

(Multiple Choice)
5.0/5
(34)

An advantage of inheritance is that:

(Multiple Choice)
4.8/5
(29)

The protected members of a class may be accessed in their base class or any classes derived from that base class.

(True/False)
4.8/5
(36)

When a derived class constructor calls its base class constructor,what happens if the base class's constructor does not assign a value to an instance variable

(Multiple Choice)
4.9/5
(34)

To avoid duplicating code (and possibly errors),use ________,rather than ________.

(Multiple Choice)
4.8/5
(32)

How can a derived class call a base class constructor

(Multiple Choice)
4.9/5
(41)

private fields of a base class can be accessed in a derived class

(Multiple Choice)
4.7/5
(32)
Showing 21 - 40 of 51
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)