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?
|
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started