-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExp44.java
More file actions
27 lines (24 loc) · 738 Bytes
/
Exp44.java
File metadata and controls
27 lines (24 loc) · 738 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
class Exp44{
static String universityName = "UPES";
String studentName;
static void displayUni(){
System.out.println(universityName);
}
public static void main(String[] args){
Exp44 first = new Exp44();
first.studentName = "Anshuman";
Exp44 second = new Exp44();
second.studentName = "Saral";
Exp44 third = new Exp44();
third.studentName = "Anadi";
System.out.println(first.universityName);
System.out.println(second.universityName);
System.out.println(third.universityName);
first.displayUni();
second.displayUni();
third.displayUni();
System.out.println(first.studentName);
System.out.println(second.studentName);
System.out.println(third.studentName);
}
}