接口相关问题
abstract class MyClass Implements Interface1, Interface2{
public void f(){}
public vlid g(){}
}
interface Interface1{
int VAL_A=1;
int VAL_B=2;
void f();
void g();
}
interface Interface2{
int VAL_B=3;
inf VAL_C=4;
void g();
void h();
}
Select the one right answer.
(a) Interface1 and Interface2 do not match, therefore MyClass cannot implement them both.
(b) MyClass only implements Interface1. Implementation for void h() from Interface2 is missing.
(c) The declarations of void g() in the two interfaces clash.
(d) The definitions of int VAL_B in the two interface class.
(e) Nothing is wrong with the code, it will compile without errors
谁能给我解释下这道题。