Exam 7: Inheritance

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

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

Free
(Multiple Choice)
4.7/5
(30)
Correct Answer:
Verified

D

A super class is also called a

Free
(Multiple Choice)
4.8/5
(39)
Correct Answer:
Verified

D

What is encapsulation?

Free
(Essay)
5.0/5
(40)
Correct Answer:
Verified

Encapsulation is synonymous with data and detail hiding.Java supports such hiding through the private modifier.

If an instance variable is not modified by public,protected or private then it is said to have:

(Multiple Choice)
4.9/5
(34)

What are the different ways in which you can check the class of an Object?

(Essay)
4.7/5
(36)

Inheritance promotes code ___________.

(Multiple Choice)
4.7/5
(40)

Define a derived class to represent an alarm clock.Use the Clock class,created in number 2 above,as your base class.

(Essay)
4.8/5
(43)

You may substitute the keyword this for super()to call a constructor of the derived class.

(True/False)
4.9/5
(33)

Write Java statements that compares Objects,O1 and O2,using the getClass()method.

(Essay)
4.9/5
(35)

Explain the difference between method overloading and method overriding.

(Essay)
4.8/5
(42)

The class __________ is an ancestor class of all Java classes.

(Multiple Choice)
4.8/5
(33)

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

(Multiple Choice)
4.8/5
(31)

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

(True/False)
4.7/5
(38)

The keyword extends indicates:

(Multiple Choice)
4.9/5
(37)

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

(True/False)
4.9/5
(33)

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
(32)

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

(True/False)
4.8/5
(42)

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

(True/False)
4.9/5
(37)

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

(True/False)
4.8/5
(37)

Inheritance refers to a very specialized form of a class.

(True/False)
4.8/5
(29)
Showing 1 - 20 of 43
close modal

Filters

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