Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A class named Actor extends class Movie and both classes have a method called getName ( ) that contains different code. An actor object tomCrui
A class named Actor extends class Movie and both classes have a method called getName that contains different code. An actor object tomCrui se and a movie object missionImpossible have been created. Assume tomcruise gets assigned to missionImpossible
ie missionImpossible tomCruise and we call missionImpossible. getName the code inside of the getName method in the Actor class will be executed
To get a polymorphic operation as described above, which of the following must be true.
Select all that apply
The getName method must be a member of the subclass: Actor
The getName method must be a member in the superclass: Movie
The superclass and subclass method signatures must be the same
The superclass and subclass method return types must be the same.
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