Exam 10: Introduction to Inheritance

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

The ability to use inheritance in Java makes programs easier to write, ____, and more quickly understood.

(Multiple Choice)
4.8/5
(31)

Create a class named Student that contains methods getGPA() , setIDNum() , and setGPA() . Be sure to declare variables and methods appropriately as public or private.

(Essay)
4.8/5
(39)

When you create a class and do not provide a(n) ____, Java automatically supplies you with a default one.

(Multiple Choice)
4.8/5
(40)

The term ____ means "many forms."

(Multiple Choice)
4.8/5
(44)

What is the difference between derived classes and base classes when considering two classes that inherit from each other?

(Essay)
4.9/5
(34)

Using the keyword ____ provides you with an intermediate level of security between public and private access.

(Multiple Choice)
4.9/5
(35)

____ is a mechanism that enables one class to acquire all the behaviors and attributes of another class.

(Multiple Choice)
4.7/5
(39)

Usually, the subclass constructor only needs to initialize the ____ that are specific to the subclass.

(Multiple Choice)
4.8/5
(38)
Match each term with the correct statement below.
Premises:
"has a"
Responses:
superclass
aggregation
instanceof
Correct Answer:
Verified
Premises:
Responses:
"has a"
superclass
(Matching)
4.8/5
(39)
Match each term with the correct statement below.
Premises:
A part of UML
Responses:
fragile
class diagram
subtype polymorphism
Correct Answer:
Verified
Premises:
Responses:
A part of UML
fragile
(Matching)
5.0/5
(33)

What are the three types of methods that you cannot override in a subclass?

(Essay)
4.9/5
(45)

Which of the following statements depicts the valid format to call a superclass constructor from a subclass constructor?

(Multiple Choice)
4.8/5
(40)

It is useful to override the parent class members when the superclass data fields and methods are not completely appropriate for the subclass objects.

(True/False)
4.9/5
(40)
Match each term with the correct statement below.
Premises:
Determines whether an object is a member or descendant of a class
Responses:
upcast
inheritance
UML
Correct Answer:
Verified
Premises:
Responses:
Determines whether an object is a member or descendant of a class
upcast
(Matching)
4.8/5
(37)

You have a Student class with a constructor that requires two arguments: a character "F" for Freshman and an integer "2020" for the year. Create a Freshman class that is a subclass of Student with a constructor for Freshman . Include the initial super() statement and include a comment that reads "//Other statements go here".

(Essay)
4.9/5
(38)

The class used as a basis for inheritance is the ____ class.

(Multiple Choice)
4.7/5
(37)

A nonstatic method cannot  override a static member  of a parent class.

(True/False)
4.9/5
(48)

What does polymorphism mean in Java programming?

(Essay)
4.9/5
(41)
Showing 61 - 78 of 78
close modal

Filters

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