1.定义一个学生类(Student),属性有private的名字(name), public的年龄(age),专业(specialty)和封装name属性的方法:setName(),getName()
class student{ private String name; public String specialty; public int age; public student(String name,int age,String specialty) { this.name=name; this.age=age; this.specialty=specialty; } publ...
原创
2018-05-14 13:45:07 ·
25754 阅读 ·
0 评论