要求:(已经是“概念世界”,不需要你去抽象,本案例已经省略了“现实世界”步骤)
设计一个学生类Student,学生有静态特征:姓名、年龄;
动态特征:,写“好好学习,天天向上”5遍。
创建一个Student类的对象:张三峰,让他学习一下。
public class Student {
private static String name;
private static int age;
public void show(){
for(int i=0;i<5;i++){
System.out.println("好好学习,天天向上");
}
}
public static void main(String[] args) {
Student student=new Student();
student.show();
}
}