Skip to content

Commit ad7f3dc

Browse files
Java Inheritance
1 parent dc09a71 commit ad7f3dc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Java_Inheritance.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class cls2 extends cls1
2+
{
3+
void mul(int p,int q)
4+
{
5+
System.out.println(p*q);
6+
}
7+
void task(int p,int q)
8+
{
9+
//Add your code here.
10+
System.out.println(p*p+q*q);
11+
}
12+
}

0 commit comments

Comments
 (0)