/*
Student学生类
属性:name姓名
属性:age年龄
属性:gendey性别
行为:sleep睡觉
行为:study学习
*/
class Demo11_Student {
public static void main(String[] args) {
student s = new student();
s.name = "李四";
s.age = 21;
s.gendey = "男";
System.out.println(s.name+"..."+s.age+"..."+s.gendey);
s.study();
s.sleep();
}
}
class student {
String name;
int age;
String gendey;
public void study() {
System.out.println("学习");
}
public void sleep() {
System.out.println("睡觉");
}
}
|
|