0
点赞
收藏
分享

微信扫一扫

Day39---简单方法

高子歌 2022-04-14 阅读 126
开发语言

简单方法

package Oop;

public class Oop02 {
    //静态方法 static
    public static void main(String[] args) {
        //new Student01().say();
        Student01 student01 = new Student01();
        student01.say();


    }
    
    //static 两个函数可以相互调用 
    //一个静态函数和一个非静态函数不可以相互调用
    public static void a(){
        
    }
    public static void b(){
        
    }
    
}

package Oop;

public class Student01 {
    public void say(){
        System.out.println("学生说话了");
    }

}

举报

相关推荐

0 条评论