Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public class Test extends A
  2. {
  3. public void bar() {
  4. System.out.println("child bar");
  5. }
  6. public static void foo() {
  7. System.out.println("child static foo");
  8. }
  9. }
  10.  
  11. class A {
  12. public static void foo() {
  13. System.out.println("parent static foo");
  14. }
  15.  
  16. public void bar() {
  17. System.out.println("parent bar");
  18. }
  19. public static void main(String[] args) {
  20. A parent = new A();
  21. A child = new Test();
  22. parent.bar();
  23. child.bar();
  24. parent.foo();
  25. child.foo();
  26. }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement