The Java Program: StaticDDD.java
1
2
3 class Base {
4 void method1 () {
5 System.out.println ("Base.method1()");
6 method2();
7 Base.method2();
8 Derived.method2();
9 }
10 static void method2 () { System.out.println ("Base.method2()"); }
11 }
12
13 class Derived extends Base {
14 void method1 () {
15 System.out.println ("Derived.method1()");
16 super.method1();
17 }
18 static void method2 () { System.out.println ("Dervied.method2()"); }
19 }
20
21 public class StaticDDD {
22 public static void main (String[] args) {
23 new Derived().method1();
24 new Base().method1();
25 }
26 }
27
28
29
30
31
32
33
34
35
36
37
38