code_junkie

Polymorphism

Nov 12th, 2011
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. public Interface Dictionary {
  2. ...
  3. public void insert();
  4. ...
  5. }
  6.  
  7. public Class BSTree implements Dictionary {
  8. ...
  9. public void insert() {
  10. // some implementation here
  11. }
  12. ...
  13. }
  14.  
  15. public Class AVLTree extends BSTree {
  16. ...
  17. public void insert() {
  18. // another implementation of insert
  19. }
  20. ...
  21. }
Add Comment
Please, Sign In to add comment