关于下列代码说法正确的是:( )
public interface DoStuff2 {
float getRange(int low, int high);
}
interface DoMore {
float getAvg(int a, int b, int c);
}
abstract class DoAbstract implements DoStuff2, DoMore {}
class DoStuff implements DoStuff2 {
public float getRange(int x, int y) {
return 3.14f;
}
}
interface DoAll extends DoMore {
float getAvg(int a, int b, int c, int d);
}无编译错误
代码abstract class DoAbstract implements DoStuff2, DoMore {行,编译错误
代码interface DoAll extends DoMore {行,编译错误
代码float getAvg(int a, int b, int c, int d);行,编译错误
接口允许多继承;
抽象类实现接口,接口方法可暂不实现
interface DoAll 继承 DoMore时,getAvg方法,属于重载而不是重写。
抽象类实现接口,接口方法可暂不实现
interface DoAll 继承 DoMore时,getAvg方法,属于重载而不是重写。