-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent.java
More file actions
47 lines (41 loc) · 1.36 KB
/
student.java
File metadata and controls
47 lines (41 loc) · 1.36 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
43
44
45
46
47
package Arrays;
public class student {
String name;
int age;
int year;
String degree;
final String college = "JIT";
String blood;
char gender;
int roll;
int marks;
public student() {}
public student(String name, int age, int year, String degree, int marks, String blood, char gender, int roll) {
this.name = name;
this.age = age;
this.year = year;
this.degree = degree;
this.marks = marks;
this.blood = blood;
this.gender = gender;
this.roll = roll;
}
@Override
public String toString() {
return "[Name=" + name + ", Age=" + age + ", Year=" + year +
", Degree=" + degree + ", College=" + college +
", Blood=" + blood + ", Gender=" + gender +
", Roll=" + roll + ", Marks=" + marks + "]";
}
public void displayStudent() {
System.out.println("Name: " + name);
System.out.println("Age: " + age);
System.out.println("Year: " + year);
System.out.println("Degree: " + degree);
System.out.println("College: " + college);
System.out.println("Blood: " + blood);
System.out.println("Gender: " + gender);
System.out.println("Roll No.: " + roll);
System.out.println("Marks: " + marks);
}
}