code_junkie

In Java, how to I call a base class's method from the overriding method in a derived class?

Nov 12th, 2011
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. class A
  2. {
  3. public void myMethod()
  4. { /* ... */ }
  5. }
  6.  
  7. class B extends A
  8. {
  9. public void myMethod()
  10. { /* Another code */ }
  11. }
  12.  
  13. public void myMethod()
  14. {
  15. // B stuff
  16. super.myMethod();
  17. // B stuff
  18. }
  19.  
  20. super.baseMethod(params);
Add Comment
Please, Sign In to add comment