Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Test extends A
- {
- public void bar() {
- System.out.println("child bar");
- }
- public static void foo() {
- System.out.println("child static foo");
- }
- }
- class A {
- public static void foo() {
- System.out.println("parent static foo");
- }
- public void bar() {
- System.out.println("parent bar");
- }
- public static void main(String[] args) {
- A parent = new A();
- A child = new Test();
- parent.bar();
- child.bar();
- parent.foo();
- child.foo();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement