method hiding
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.scope.method;
|
||||
|
||||
|
||||
public class BaseMethodClass {
|
||||
|
||||
public static void printMessage() {
|
||||
System.out.println("base static method");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.scope.method;
|
||||
|
||||
|
||||
public class ChildMethodClass extends BaseMethodClass {
|
||||
|
||||
public static void printMessage() {
|
||||
System.out.println("child static method");
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.baeldung.scope.method;
|
||||
|
||||
/**
|
||||
* Created by Gebruiker on 5/6/2018.
|
||||
*/
|
||||
public class MethodHidingDemo {
|
||||
public static void main(String[] args) {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ChildMethodClass.printMessage();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user