method hiding

This commit is contained in:
mherbaghinyan 2018-05-12 10:56:27 +04:00
parent 0ee2e1adfc
commit 35c5016dac
3 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,9 @@
package com.baeldung.scope.method;
public class BaseMethodClass {
public static void printMessage() {
System.out.println("base static method");
}
}

View File

@ -0,0 +1,9 @@
package com.baeldung.scope.method;
public class ChildMethodClass extends BaseMethodClass {
public static void printMessage() {
System.out.println("child static method");
}
}

View File

@ -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();
}
}