forked from SukuyaZ/PrincessLunaZ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.java
22 lines (18 loc) · 807 Bytes
/
data.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public class StaticVarExample {
public static String myClassVar="Ellie-chan";
public static void main(String args[]){
StaticVarExample obj = new StaticVarExample();
StaticVarExample obj2 = new StaticVarExample();
StaticVarExample obj3 = new StaticVarExample();
//All three will display "class or static variable"
System.out.println(obj.myClassVar);
System.out.println(obj2.myClassVar);
System.out.println(obj3.myClassVar);
//changing the value of static variable using obj2
obj2.myClassVar = "Njk1MzcwMTA1MzA3MTM2MTMy.XoZL4A.M0H2AksxJVnecDPROVmGhFSdBQc";
//All three will display "Changed Text"
System.out.println(obj.myClassVar);
System.out.println(obj2.myClassVar);
System.out.println(obj3.myClassVar);
}
}