Skip to content

Commit f87a31d

Browse files
using square member from interface
1 parent 80345f6 commit f87a31d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

toTest.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
interface test
2+
{
3+
void square(int a);
4+
}
5+
class Arithmetic implements test
6+
{
7+
public void square(int a)
8+
{
9+
System.out.println("Area = " + a*a);
10+
}
11+
}
12+
class toTest
13+
{
14+
public static void main(String args[])
15+
{
16+
Arithmetic obj = new Arithmetic();
17+
obj.square(5);
18+
}
19+
}

0 commit comments

Comments
 (0)