-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java.txt
More file actions
37 lines (35 loc) · 1.23 KB
/
Student.java.txt
File metadata and controls
37 lines (35 loc) · 1.23 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
//Ex-1
import java.util.Scanner;
public class Student
{
private static String Branch;
public Student(String stuUSN,String stuName,String stuBranch,String stuPhone)
{
System.out.println("Student USN is:"+stuUSN);
System.out.println("Student Name is:"+stuName);
System.out.println("Student Brach is:"+stuBranch);
System.out.println("Student Number is:"+stuPhone);
}
/**
*
* @param args
*/
public static void main(String[] args)
{
Scanner readInput = new Scanner(System.in);
System.out.println("Enter the number of student objects to create");
int numberOfStudent = readInput.nextInt();
for(int i = 1; i <= numberOfStudent; i++)
{
System.out.println("Enter the studnet USN");
String usn = readInput.next();
System.out.println("Enter the studnet Name");
String Name = readInput.next();
System.out.println("Enter the studnet Brach");
String Brach = readInput.next();
System.out.println("Enter the studnet Phone");
String Phone = readInput.next();
new Student(usn, Name,Branch,Phone);
}
}
}