I've been at this for well over an hour now.
5. The speed method must return a Double and accept one CanFly argument
5. The CanFly interface must declare a speed method with one CanFly parameter and must return a Double.
5. The CanFly interface must declare a speed method with one CanFly parameter and must return a Double.
Recommendation from mentor
There must be a speed method in the CanFly interface and it must not accept arguments.
line 9, line 16, and verify step 5 appear to be in direct conflict with the recommendation from the mentor.
I need a clear reference of what exactly a CanFly argument / CanFly parameter is, and how it can be passed against itself.
I've been all over google, and the previous lessons, and I haven't found anything useful.
I need an example, a reference document, or an extended explanation.
package com.codegym.task.task13.task1309;
/*
All that moves
1.X Create a CanMove interface that has a speed method.
2.X The speed method must return a Double and should not accept any arguments.
3.X Make the CanFly interface inherit the CanMove interface.
4.X Add the speed method to the CanFly interface.
5. The speed method must return a Double and accept one CanFly argument.
Requirements:
1.X The Solution class must declare a CanMove interface.
2.X The Solution class must declare a CanFly interface.
3.X The CanFly interface must inherit the CanMove interface.
4.X The CanMove interface must declare a speed method with no parameters and must return a Double.
5. The CanFly interface must declare a speed method with one CanFly parameter and must return a Double.
*/
public class Solution {
public static void main(String[] args) {
}
interface CanMove{
Double spd = 1.1;
default Double speed() {
return spd;
}
}
interface CanFly extends CanMove {
}
}