Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. Comparable<T> --> Animal --> Cat
  2. +---> Dog
  3.  
  4. Animal cat = new Cat();
  5. Animal dog = new Dog();
  6. cat.Compare(dog); // ERR
  7.  
  8. type Animal ... compare(cmp Self) ...
  9. type Cat ... compare(cmp Self) ...
  10. type Dog ... compare(cmp Self) ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement