Question: Assume you need to write a class Racedog. It should be a sub-class of class Dog. Racedogs take part in dog races and they are

Assume you need to write a class Racedog. It should be a sub-class of class Dog. Racedogs take part in dog races and they are very fast. You want to override the method move of class Dog by printing the text it always printed (run) but you want to add " fast" (run fast)

In order to do that your implementation of the overridden move method calls the move method of the super-class. Which of the following method calls of the super-class implementation is correct?

move.super();
super();
super(move);
move(super);

super.move();

_______________________________________________________

Assume you have a class Friend that is a sub-class of class Human.

You have two variables: Friend boyA = new Friend("Mike"); Human boyB = new Human("Fritz");

Which of the following conditions checks whether boyB is a friend?

(boyB instanceof Friend)
(boyB instanceof boyA)
(instanceof(boyB, Friend))
(instanceof(boyB, boyA))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!