forked from akash-coded/C133-Java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassInAnInterface.java
More file actions
31 lines (26 loc) · 848 Bytes
/
ClassInAnInterface.java
File metadata and controls
31 lines (26 loc) · 848 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
interface OuterInterface {
int num = 10;
void interfaceFun();
class NestedClass {
static int x = 10;
private int y = 20;
public void classNonStaticFun() {
System.out.print("Instance Method of Nested Class:: ");
System.out.println(x + " " + y + " ");
System.out.println(num);
}
public static void classStaticFun() {
System.out.print("Static Method of Nested Class:: ");
System.out.println(x + " ");
System.out.println(num);
}
}
}
public class ClassInAnInterface {
public static void main(String[] args) {
OuterInterface.NestedClass obj = new OuterInterface.NestedClass();
obj.classNonStaticFun();
obj.classStaticFun();
OuterInterface.NestedClass.classStaticFun();
}
}