面对对象2
//一个项目只存在一个main方法
public class Appliction {
public static void main(String[] args) {
}
}
//学生类
public class Student {
//属性,字段
String name;
int age;
//方法
public void study(){
System.out.println(this.name+"在学习");
}
}
/*
//类,抽象的,实例化
//类实例化后会返回一个自己的对象;
//student 对象就是一个Student类的具体实例;
Student xiaoming=new Student();
Student xiaohong=new Student();
System.out.println(xiaohong.name);
System.out.println(xiaoming.age);
*/