12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- package com.sf.sx.day04;
- /**
- * 学生类
- */
- public class Student {
- // 属性
- private String sno;
- private String sName;
- private Integer age;
- private Double height;
- public Student() {
- }
- public Student(String sno, String sName, Integer age, Double height) {
- this.sno = sno;
- this.sName = sName;
- this.age = age;
- this.height = height;
- }
- public String getSno() {
- return sno;
- }
- public void setSno(String sno) {
- this.sno = sno;
- }
- public String getsName() {
- return sName;
- }
- public void setsName(String sName) {
- this.sName = sName;
- }
- public Integer getAge() {
- return age;
- }
- public void setAge(Integer age) {
- this.age = age;
- }
- public Double getHeight() {
- return height;
- }
- public void setHeight(Double height) {
- this.height = height;
- }
- @Override
- public String toString() {
- return "Student{" +
- "sno='" + sno + '\'' +
- ", sName='" + sName + '\'' +
- ", age=" + age +
- ", height=" + height +
- '}';
- }
- /**
- * 学习方法
- * @param sName
- */
- public void study(String sName){
- System.out.println(sName+" 正在学习~");
- }
- /**
- * 吃饭
- */
- public void eat(){
- System.out.println("学生正在吃饭~");
- }
- }
|