假如接口A中还有接口C- public interface A
- {
- public interface B{}
- public interface C{}
-
- }
- public class Test
- {
- public static void main(String[] args)
- {
- new shixian().show();
- new shixian2().show();
- }
-
- }
- class shixian implements A
- {
- public interface B
- {
- public void show();
- }
-
- public void show()
- {
- System.out.println("A");
- }
- }
- class shixian2 implements shixian.B
- {
- public void show()
- {
- System.out.println("B");
- }
-
- }
复制代码 接口C不实现也没问题 |