Guest User

Untitled

a guest
Dec 13th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. public class GenericsExample {
  2.  
  3. private Map<?, Processor<?>> processors = new HashMap<>();
  4.  
  5. public <O> void parameterisedMethod(O o) {
  6. processors.put(o, new Processor<O>());
  7. }
  8.  
  9. static class Processor<T> {
  10. void process(T t) {
  11. System.out.println(t + " processed.");
  12. }
  13. }
  14.  
  15. public static void main(String[] args) {}
  16. }
Add Comment
Please, Sign In to add comment