-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
42 lines (42 loc) · 1.22 KB
/
Student.java
File metadata and controls
42 lines (42 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class Student {
private String StudentNo;
private String StudentName;
private Date dateofbirth;
private int meritpoints;
public static int NoofStudent = 0;
public Student(){
NoofStudent++;
}
public Student( String Studentno , String name , Date dob , int meritpoints){
this.StudentNo = Studentno ;
this.StudentName = name ;
this.dateofbirth = dob;
if(meritpoints>20 && meritpoints <200 )
this.meritpoints = meritpoints ;
NoofStudent++;
}
public void setStudentNo(String StudentNo){
this.StudentNo=StudentNo;
}
public String getStudentNo() {
return StudentNo;
}
public void setStudentName(String StudentName){
this.StudentName=StudentName;
}
public String getStudentName() {
return StudentName;
}
public void setDate_Of_Birth(Date Date_Of_Birth){
this.dateofbirth=Date_Of_Birth;
}
public Date getDateofbirth() {
return dateofbirth;
}
public int getMeritpoints() {
return meritpoints;
}
public String toString(){
return String.format("The Number Of Students With Increament:%d%nThe Student Reg.No:%s%nThe Student Name is:%s%nThe Student Date Of Birth is:%s%n",NoofStudent,StudentNo,StudentName,dateofbirth,meritpoints );
}
}