We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6a960cd commit 0aba8d8Copy full SHA for 0aba8d8
48.Method_Overriding/cwh_48_method_overriding.java
@@ -0,0 +1,29 @@
1
+class A {
2
+ public int a;
3
+ public int harry() {
4
+ return 4;
5
+ }
6
+ public void meth2() {
7
+ System.out.println("I am method 2 of class A");
8
9
+}
10
+
11
+class B extends A {
12
+ @Override
13
14
+ System.out.println("I am method 2 of class B");
15
16
+ public void meth3() {
17
+ System.out.println("I am method 3 of class B");
18
19
20
21
+public class cwh_48_method_overriding {
22
+ public static void main(String[] args) {
23
+ A a = new A();
24
+ a.meth2();
25
26
+ B b = new B();
27
+ b.meth2();
28
29
0 commit comments