-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
25 lines (21 loc) · 830 Bytes
/
Main.java
File metadata and controls
25 lines (21 loc) · 830 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
package Student_Database_App;
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner userInput = new Scanner(System.in);
// get students count
System.out.print("Enter the number of students to add in DB : " );
int studentCount = userInput.nextInt();
// create array of objects for studentInfo type
StudentInfo[] studentArray = new StudentInfo[studentCount];
for (int iterator = 0; iterator < studentCount; iterator++) {
studentArray[iterator] = new StudentInfo();
}
// display all details
for (StudentInfo element:studentArray) {
System.out.println(element.display());
}
// studentArray[]
}
}