Question: Given the following pairs of method declarations, which statements are true? Select the two correct answers. (a) The first pair of methods will compile, and

Given the following pairs of method declarations, which statements are true?

void fly (int distance) {} int fly (int time, int speed) {

Select the two correct answers.

(a) The first pair of methods will compile, and overload the method name fly.

(b) The second pair of methods will compile, and overload the method name fall.

(c) The third pair of methods will compile, and overload the method name glide.

(d) The first pair of methods will not compile.

(e) The second pair of methods will not compile.

(f) The third pair of methods will not compile.

void fly (int distance) {} int fly (int time, int speed) { return time *speed; } void fall (int time) {} int fall (int distance) { return distance; } void glide (int time) {} void Glide (int time) {}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a and e The first and third pairs of methods will compile The s... View full answer

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 Java Programming 8th Questions!