范例:一对多

student类

1 class Student 2 { 3private String name; age; 5private School school;Student(String name,int age) 8 { 9this.setName(name);10this.setAge(age);11 } String getName()14 {15return name;16 } setName(String name)19 {20this.name = name;21 } getAge()24 {25return age;26 }setAge(int age)29 {30this.age = age;31 } School getSchool()34 {35return school;36 } setSchool(School school)39 {40this.school = school;41 } String toString()44 {45return “\t|-姓名:”+this.name+”,年龄;”+this.age;46 }47 },美国空间,香港虚拟主机,香港服务器租用让所有的愁向后飞去。请不要回头去追你因该向前奔跑,因为快乐在前方!

范例:一对多

相关文章:

你感兴趣的文章:

标签云: