Guest User

Untitled

a guest
Jun 25th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. public class A {
  2. public void m1() {
  3. System.out.println("A m1");
  4. }
  5. }
  6.  
  7. public class B extends A {
  8.  
  9. public void m1() {
  10. System.out.println("B m1");
  11. }
  12.  
  13. public void m2() {
  14. System.out.println("B m2");
  15. }
  16.  
  17. public class Result {
  18.  
  19. public static void main(String[] args) {
  20. // TODO Auto-generated method stub
  21. /*A a = new A();
  22. a.m1();
  23.  
  24. B b = new B();
  25. b.m1();
  26. b.m2();
  27. */
  28. A ab = new B();
  29. ab.m1();
  30. }
Add Comment
Please, Sign In to add comment