Exam 7: Inheritance

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

A constructor for a derived class begins with an invocation of a constructor for the base class.

(True/False)
5.0/5
(40)

Create a test driver to test the functionality of your AlarmClock class created in number 3 above.

(Essay)
4.9/5
(41)

Inheritance is the process by which a new class - known as a _________ - is created from another class,called the _____________.

(Multiple Choice)
4.8/5
(32)

Explain what a call to super)does in a constructor of a derived class.

(Essay)
4.8/5
(46)

Explain the modifiers public,protected and private.

(Essay)
4.7/5
(41)

If the final modifier is added to the definition of a method,this means:

(Multiple Choice)
4.7/5
(41)

A base class is synonymous with a:

(Multiple Choice)
4.8/5
(35)

An instance variable or method)that is private in a base class is accessible by name in the definition of a method in any other class.

(True/False)
4.8/5
(39)

Private methods of the base class are not available for use by derived classes.

(True/False)
4.8/5
(33)

Create a class to represent a Rectangle.Your class should contain instance variables for length and width,as well as member method to calculate the area and perimeter.

(Essay)
5.0/5
(48)

The special syntax for invoking a constructor of the base class is:

(Multiple Choice)
4.8/5
(46)

Overriding is when a derived class redefines a method from the base class.

(True/False)
4.8/5
(36)

In using the keyword this in place of super),the invocation of this must be the ___________ action taken by the constructor.

(Multiple Choice)
4.9/5
(35)

A derived class is a class defined by adding instance variables and methods to an existing class.

(True/False)
4.8/5
(33)

What does a derived class automatically inherit from the base class?

(Multiple Choice)
4.8/5
(36)

An object of a derived class has the type of the derived class,and it also has the type of the base class,and more generally,has the type of every one of its ___________ classes.

(Multiple Choice)
4.9/5
(39)

The equals method for a class should have _________ as the type of its one parameter.

(Multiple Choice)
5.0/5
(38)

A derived class is also called a

(Multiple Choice)
4.9/5
(29)

The call to the base class constructor super)must always be the last action taken in a constructor definition.

(True/False)
4.8/5
(26)

Explain how parent and child classes are related to base and derived classes.

(Essay)
4.9/5
(36)
Showing 21 - 40 of 43
close modal

Filters

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