本帖最后由 librazeng 于 2013-6-9 09:42 编辑
求解决~- //定义一个接口A
- interface A{
- public static final int a =6;
- ...
- }
- //定义一个接口B
- interface B{
- public static final int a =5;
- ...
- }
- //类C实现了接口A和接口B
- class C extends A,B{
- public static void main(String[] args) {
- //调用本类的常量时出现调用冲突:The field ConstantC.a is ambiguous
- System.out.println(ConstantC.a);
- }
- ...
- }
复制代码 |