Exam 9: Inheritance

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

In what manners are Timer objects similar to and different from other GUI components?

(Essay)
4.7/5
(35)

The reserved word, extends, is used to denote a has-a relationship.

(True/False)
4.8/5
(35)

Which of the following is not a method of the Object class?

(Multiple Choice)
4.7/5
(34)

Two children of the same parent class are known as

(Multiple Choice)
4.7/5
(33)

A motorcycle inherits properties from both a bicycle and a car. Java does not permit multiple inheritance. Assume that Bicycle and Car have both been declared. Explain how you might go about implementing a Motorcycle as a derived class.

(Essay)
4.8/5
(31)

What methods inherited from Car should SportsCar override?

(Essay)
4.9/5
(33)

Inheritance through an extended (derived) class supports which of the following concepts?

(Multiple Choice)
5.0/5
(39)

For the questions below, consider the following class definition: public class AClass { protected int x; protected int y; public AClass(int a, int b) { x = a; y = b; } public int addEm( ) { return x + y; } public void changeEm( ) { x++; y--; } public String toString( ) { return "" + x + " " + y; } } -Consider that you want to extend AClass to BClass. BClass will have a third int instance data, z. Which of the following would best define BClass'constructor?

(Multiple Choice)
4.8/5
(31)

Explain the difference between implementing an interface and a derived class.

(Essay)
4.8/5
(41)

If A, B, Y and Z all contain the same instance data d1, then d1 should be declared in X and inherited into Y, Z, A and B.

(True/False)
4.9/5
(38)

Using the reserved word, super, one can

(Multiple Choice)
4.9/5
(30)
Showing 61 - 71 of 71
close modal

Filters

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