-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQB 623.java
More file actions
44 lines (35 loc) · 1.01 KB
/
QB 623.java
File metadata and controls
44 lines (35 loc) · 1.01 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
//QB 623
import java.util.*;
class student {
int rno;
String n;
long mo;
public static void main(String args[]) {
student[] b = new student[5];
for (int i = 0; i < b.length; i++) {
b[i] = new student();
}
for (int i = 0; i < b.length; i++) {
b[i].input();
}
for (int i = 0; i < b.length; i++) {
b[i].print();
}
}
void input() {
Scanner sc = new Scanner(System.in);
System.out.println("Enter your Roll Number: ");
rno = sc.nextInt();
sc.nextLine();
System.out.println("Enter Student Name: ");
n = sc.nextLine();
System.out.println("Enter Student Mobile number: ");
mo = sc.nextLong();
}
void print() {
System.out.println("------------------------------------");
System.out.println("Your Roll No is " + rno);
System.out.println("Your Name is " + n);
System.out.println("Your mobile number is " + mo);
}
}