// 学生类
public class Student {// 属性String name; // 默认 nullint age; // 默认 0// 方法public void study(){System.out.println(this.name + " 在学习");}
}
public class Application {public static void main(String[] args) {// 实例化后会返回一个自己的对象// student 对象就是一个Student类的具体实例Student student = new Student();Student xiaoming = new Student();Student xh = new Student();xiaoming.name = "王";xiaoming.age = 18;System.out.println(xiaoming.name);System.out.println(xiaoming.age);System.out.println(xh.name);System.out.println(xh.age);}
}
https://www.bilibili.com/video/BV12J41137hu?p=63