-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathstudentUse.java
More file actions
34 lines (21 loc) · 797 Bytes
/
studentUse.java
File metadata and controls
34 lines (21 loc) · 797 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
import java.util.Scanner;
public class studentUse {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
student obj1 = new student();
student obj2 = new student();
student objArr[] = new student[3];
System.out.println(obj1);
obj1.name = "bunty";
// obj1.rollNo = 07;
obj1.setRollNo(7);
obj2.name = "bunty2";
//obj2.rollNo = 06;
obj2.setRollNo(6);
System.out.println(obj1.name + " " + obj1.getRollNO());
System.out.println(obj2.name + " " + obj2.getRollNO());
student obj3 = new student("car", 777);
System.out.println(obj3.name + " " + obj3.getRollNO());
obj3.display();
}
}