Which of the following method declarations overrides this method? double calcula
ID: 3711824 • Letter: W
Question
Which of the following method declarations overrides this method?
double calculateMilesPerGallon(double speed){...}
A) double calculateMilesPerGallon(int speed){...}
B) calculateMilesPerGallon(double s){...}
C) double calculateMilesPerGallon(double speed, int r){...}
D) double calculate(double speed){...}
A) double calculateMilesPerGallon(int speed){...}
B) calculateMilesPerGallon(double s){...}
C) double calculateMilesPerGallon(double speed, int r){...}
D) double calculate(double speed){...}
Explanation / Answer
//if you have any query then comment below.please rate the answer
Answer:- A) double calculateMilesPerGallon(int speed){...}
Explanation:- In overriding concept if in a method argument is of the child class is the low priority then it will correct, so here parent parameter is double and the child parament is int so it is true.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.