-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent management.java
More file actions
39 lines (39 loc) · 1.3 KB
/
student management.java
File metadata and controls
39 lines (39 loc) · 1.3 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
import java.util.Scanner;
class Student {
String name;
String rollnumber;
int year;
String emailid;
String phonenumber;
Student(String a, String b, int c, String d, String e) {
this.name = a;
this.rollnumber = b;
this.year = c;
this.emailid = d;
this.phonenumber = e;
}
void display() {
System.out.println("Student Name : " + name);
System.out.println("Student Roll Number : " + rollnumber);
System.out.println("Year : " + year);
System.out.println("Student Email ID : " + emailid);
System.out.println("Student Phone Number : " + phonenumber);
}
public static void main(String[] args) {
Scanner S = new Scanner(System.in);
System.out.print("Enter Name: ");
String a = S.nextLine();
System.out.print("Enter Roll Number: ");
String b = S.nextLine();
System.out.print("Enter Year: ");
int c = S.nextInt();
S.nextLine();
System.out.print("Enter Email ID: ");
String d = S.nextLine();
System.out.print("Enter Phone Number: ");
String e = S.nextLine();
Student st = new Student(a, b, c, d, e);
System.out.println("Student Details: ");
st.display();
}
}