public class Application {
//一个项目只有一个main方法
public static void main(String[] args) {
//类:抽象化、实例化
//实例化后产生一个对象
Student stu1 = new Student();
Student stu2 = new Student();
stu1.name = "张三";
System.out.println(stu1.name);
stu1.study();
System.out.println(stu2.name);
}
}
//学生类
public class Application {
//一个项目只有一个main方法
public static void main(String[] args) {
//类:抽象化、实例化
//实例化后产生一个对象
Student stu1 = new Student();
Student stu2 = new Student();
stu1.name = "张三";
System.out.println(stu1.name);
stu1.study();
System.out.println(stu2.name);
}
}
//张三
张三is studying!
null