Skip to content

Commit c155d02

Browse files
authored
Add files via upload
1 parent 687c085 commit c155d02

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Interface/NestedInterface3.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package Interface;
2+
3+
interface MyClass {
4+
interface NestedInterface {
5+
String student = "Disha";// needs to be initia;ized as its final
6+
7+
void display(int rollno);
8+
}
9+
}
10+
11+
class MyIface implements MyClass.NestedInterface {
12+
public void display(int rno) {
13+
System.out.println("Rollno:" + rno);
14+
}
15+
}
16+
17+
/**
18+
* NestedInterface1
19+
*/
20+
class NestedInterface3 {
21+
public static void main(String[] args) {
22+
MyClass.NestedInterface obj = new MyIface();
23+
System.out.println("Name:" + MyClass.NestedInterface.student);
24+
obj.display(75);
25+
}
26+
27+
}

0 commit comments

Comments
 (0)