Guest User

Untitled

a guest
Jul 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. class A ...
  2. class B extends A ...
  3. class C extends A ...
  4.  
  5. String foo() ...
  6. String bar(A a) ...
  7.  
  8. String r = (new B()).foo();
  9. String r = (new B()).bar(new C());
  10.  
  11. A fred;
  12. List as = new LinkedList();
  13. for (A a : as) ... fred.bar(a); ...
  14.  
  15. class A<T,U,V> ...
  16. class B<T> extends A<T,Void,Object> ...
  17. class C<N> extends A<String,Void,Object> ...
  18.  
  19. T foo() ...
  20.  
  21. String r = (new A<String,Void,Object>()).foo();
  22. String r = (new B<String>()).foo();
  23. String r = (new C<Integer>()).foo();
  24.  
  25. String r = (new B<String>()).foo();
  26. String r = (new B<String>()).bar(new C<Integer>());
  27.  
  28. A<String,String,Integer> fred;
  29. List<A<String,String,Integer>> as = new LinkedList<>();
  30. for (A a : as) ... fred.bar(a); ...
Add Comment
Please, Sign In to add comment