Advertisement
Guest User

Meh.java

a guest
Oct 8th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. class Meh {
  2.     interface I1 {
  3.         Foo<Number> m(String s);
  4.     }
  5.  
  6.     interface I2 {
  7.         Foo<Number> m(Integer i);
  8.     }
  9.  
  10.     static class Foo<T extends Number> {
  11.         Foo(T t) {
  12.             System.out.println(t);
  13.         }
  14.     }
  15.  
  16.     private static void m(I1 i) {
  17.         i.m("Foo");
  18.     }
  19.  
  20.     private static void m(I2 i) {
  21.         i.m(42);
  22.     }
  23.  
  24.     public static void main(String[] args) {
  25.         m(Foo::new);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement