Guest User

Untitled

a guest
Jun 21st, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. interface ILeft {}
  2. interface IRight {}
  3.  
  4. class BaseClass implements ILeft {}
  5.  
  6. class WillieClass extends BaseClass implements IRight {}
  7. class WonkaClass extends BaseClass implements IRight {}
  8.  
  9. public class TCall
  10. {
  11. <T extends ILeft & IRight> void foo(T t) {}
  12.  
  13. void bar()
  14. {
  15. foo(new WillieClass());
  16. foo(new WonkaClass());
  17. }
  18.  
  19. <T extends ILeft & IRight> void quux(T o)
  20. {
  21. foo(o);
  22. }
  23. }
Add Comment
Please, Sign In to add comment