Exam 7: Inheritance

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

Inheritance refers to a very specialized form of a class.

Free
(True/False)
4.9/5
(30)
Correct Answer:
Verified

False

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

Free
(Essay)
4.8/5
(33)
Correct Answer:
Verified

The method getClass)as well as the operator instanceof may be used to check the class type of an Object.

When you define a derived class,you give only the added instance variables and the added methods as well as all the methods from the base class.

Free
(True/False)
4.9/5
(44)
Correct Answer:
Verified

False

A super class is also called a

(Multiple Choice)
4.9/5
(35)

The keyword extends indicates polymorphism.

(True/False)
4.8/5
(39)

The Object class contains the method:

(Multiple Choice)
4.8/5
(38)

What does the instanceof operator do?

(Essay)
4.8/5
(39)

What is package access?

(Essay)
4.8/5
(36)

What is encapsulation?

(Essay)
4.9/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.9/5
(44)

Define a base class to represent a Clock.Your class should have instance variables for hours,minutes and seconds.

(Essay)
4.8/5
(30)

Create a test driver to test the functionality of your Rectangle class created in number 14 above.

(Essay)
4.9/5
(37)

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

(True/False)
4.9/5
(45)

What is an "is a" relationship? How does it apply to the world of objects?

(Essay)
4.8/5
(37)

Inheritance promotes code ___________.

(Multiple Choice)
4.9/5
(32)

Explain the difference between method overloading and method overriding.

(Essay)
4.8/5
(38)

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

(Multiple Choice)
4.8/5
(39)

A method or instance variable modified by protected:

(Multiple Choice)
4.9/5
(42)

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

(Multiple Choice)
4.8/5
(32)

The keyword extends indicates:

(Multiple Choice)
5.0/5
(35)
Showing 1 - 20 of 43
close modal

Filters

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