28-回顾方法的调用

package com.oop;

public class Demo01 {
    //静态方法 static
    //非静态方法
    public static void main(String[] args) {

        Student.say(); //类名.方法名  直接调用静态方法

        Student student = new Student(); //非静态方法调用,先实例化这个类
        student.say2();                  //然后再调用非静态方法
    }
}
posted @ 2023-02-07 21:40  佩德罗帕斯卡  阅读(11)  评论(0)    收藏  举报