JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class StaticA{
public static void staticMethod1(){
System.out.println("staticMethod1");
}
public static void staticMethod1(String string){
System.out.println(string + "staticMethod1" );
}
}
class StaticB extends StaticA{
public static void staticMethod1(){
System.out.println("overriden staticMethod1");
}
}
public class Program{
public static void main(String[] args){
StaticB b = new StaticB();
b.staticMethod1();
b.staticMethod1("overloaded ");
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run