Skip to content

Commit a2784f7

Browse files
Method Overriding in Java
1 parent 62b8639 commit a2784f7

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

48.Method_Overriding/CWH.java

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class A{
2+
public void meth1() {
3+
System.out.println("I am method 1 of class A");
4+
}
5+
}
6+
7+
class B extends A {
8+
9+
}
10+
public class CWH {
11+
public static void main(String[] args) {
12+
A a = new A();
13+
a.meth1();
14+
15+
B b = new B();
16+
b.meth1();
17+
}
18+
}

0 commit comments

Comments
 (0)