-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudent_object.java
More file actions
43 lines (26 loc) · 928 Bytes
/
student_object.java
File metadata and controls
43 lines (26 loc) · 928 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
41
42
43
package class_programs;
class Student{
String USN,name,branch;
long phone;
Student(String USN,String name,String branch,long phone){
this.USN=USN;
this.name=name;
this.branch=branch;
this.phone=phone;
}
}
public class student_object {
public static void main(String[] args) {
System.out.println("This program is written by Ashik MR, 4NI19IS017, B section");
Student[] obj=new Student[5];
obj[0]=new Student("4ni19is017","Ashik","ISE",9110874851l);
obj[1]=new Student("4ni19cs018","Joe","CSE",9534489790l);
obj[2]=new Student("4ni19is011","Betty","ISE",8990282800l);
obj[3]=new Student("4ni19is090","Taylor","ISE",7282920729l);
obj[4]=new Student("4ni19ec074","Ben","ECE",8928292729l);
System.out.println("The Student details are :");
for(int i=0;i<5;i++) {
System.out.println(obj[i].USN +" "+ obj[i].name + " "+ obj[i].branch+ " " + obj[i].phone);
}
}
}