Skip to content

Commit 2d3decf

Browse files
implement inheritance
1 parent 58b7d9f commit 2d3decf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interface AreaOfRectangle {
2+
void method();
3+
}
4+
class NewClass implements AreaOfRectangle
5+
{
6+
7+
public void method()
8+
{
9+
int a=100,b=200;
10+
System.out.println("Area of Rectangle is : "+ (a*b));
11+
}
12+
}
13+
14+
public class ImplementInterface{
15+
public static void main(String arg[])
16+
{
17+
NewClass obj = new NewClass();
18+
obj.method();
19+
}
20+
}

0 commit comments

Comments
 (0)