-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayMF.java
More file actions
40 lines (31 loc) · 829 Bytes
/
ArrayMF.java
File metadata and controls
40 lines (31 loc) · 829 Bytes
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
import java.util.Scanner;
public class ArrayMF{
int rollno;
String name;
int std;
public void Scandata(){
Scanner sc = new Scanner(System.in);
System.out.println();
System.out.println("Enter Roll No : ");
rollno = sc.nextInt();
sc.nextLine(); // it is comp. to write after number if there is name
System.out.println("Enter Name : ");
name = sc.nextLine();
System.out.println("Enter STD : ");
std = sc.nextInt();
}
public void Dispdata(){
System.out.println();
System.out.println(rollno + " " + name + " " + std);
}
public static void main(String args[]){
ArrayMF s[] = new ArrayMF[5];
for(int i = 0;i < s.length ; i++){
s[i] = new ArrayMF();
s[i].Scandata();
}
for(int i = 0;i < s.length ; i++){
s[i].Dispdata();
}
}
}