Skip to content

Commit ac5de67

Browse files
authored
Add files via upload
1 parent e681bad commit ac5de67

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

Interface/NestedInterface1.java

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

0 commit comments

Comments
 (0)