123456789101112131415161718192021222324 |
- package J20250717.demo03_interface02;
- /**
- * @author WanJl
- * @version 1.0
- * @title Demo03
- * @description
- * @create 2025/7/17
- */
- public class Demo03 implements MyInter05{
- public static void main(String[] args) {
- Demo03 d3=new Demo03();
- //d3.method(); 实现类对象,无法调用接口的静态方法
- MyInter05.method(); //只要接口名才能调用自己的静态方法
- //Demo03.method(); //实现类类名,无法调用接口的静态方法
- }
- }
- interface MyInter05{
- static void method(){
- System.out.println("05的静态方法");
- }
- }
|