1 public class Students { 2 private String name; 3 private String age; 4 private String sex; 5 private String classes; 6 public String getName() { 7 return name; 8 } 9 public Students(String name, String age, String sex, String classes) { 10 super(); 11 this.name = name; 12 this.age = age; 13 this.sex = sex; 14 this.classes = classes; 15 } 16 17 @Override 18 public int hashCode() { 19 final int prime = 31; 20 int result = 1; 21 result = prime * result + ((name == null) ? 0 : name.hashCode()); 22 return result; 23 } 24 @Override 25 public boolean equals(Object obj) { 26 if (this == obj) 27 return true; 28 if (obj == null) 29 return false; 30 if (getClass() != obj.getClass()) 31 return false; 32 Students other = (Students) obj; 33 if (name == null) { 34 if (other.name != null) 35 return false; 36 } else if (!name.equals(other.name)) 37 return false; 38 return true; 39 } 40 public void setName(String name) { 41 this.name = name; 42 } 43 public String getAge() { 44 return age; 45 } 46 public void setAge(String age) { 47 this.age = age; 48 } 49 public String getSex() { 50 return sex; 51 } 52 public void setSex(String sex) { 53 this.sex = sex; 54 } 55 public String getClasses() { 56 return classes; 57 } 58 public void setClasses(String classes) { 59 this.classes = classes; 60 } 61 public Students() { 62 // TODO Auto-generated constructor stub 63 } 64 65 66 67 68 69 70 }