-
Notifications
You must be signed in to change notification settings - Fork 86
/
SubClass.java
48 lines (38 loc) · 907 Bytes
/
SubClass.java
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
44
45
46
47
48
package package1;
public class SubClass extends SuperClass {
private int counter;
private InnerClass inner;
private SubClass instanceObject;
private static InnerClass staticInner;
private static int staticInt= 0;
public void bar() {
super.intParent++;
instanceObject.counter++;
this.instanceObject.counter++;
intParent= staticInt + 1;
int localInt= 0;
this.counter++;
counter++;
this.counter= this.counter + 1;
this.instanceMethod(1);
instanceMethod(1);
staticMethod();
this.getInstance().getInstance().instanceMethod(1);
this.inner.printHello();
}
public void instanceMethod(int i) {
this.bar();
}
public static void staticMethod() {
SubClass foo= new SubClass();
foo.bar();
}
public SubClass getInstance() {
return new SubClass();
}
private class InnerClass {
public void printHello() {
System.out.println("Hello from InnerClass!");
}
}
}