Demo01.java 428 B

1234567891011121314151617181920212223
  1. package J20250717.demo03_interface02;
  2. /**
  3. * @author WanJl
  4. * @version 1.0
  5. * @title MyInter
  6. * @description 如果一个类实现两个接口,且两个接口具有相同名方法,那么只需要实现一次。
  7. * @create 2025/7/17
  8. */
  9. public class Demo01 implements MyInter01,MyInter02{
  10. @Override
  11. public void method() {
  12. }
  13. }
  14. interface MyInter01{
  15. void method();
  16. }
  17. interface MyInter02{
  18. void method();
  19. }