Advertisement
Guest User

Untitled

a guest
Nov 26th, 2010
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.35 KB | None | 0 0
  1. interface A {
  2.     void a();
  3. }
  4. interface B {
  5.     void b();
  6. }
  7. class C implements A, B  {
  8.     public void a(){System.out.println("a");}
  9.     public void b(){System.out.println("b");}
  10. }
  11. class Mixed {
  12.     public static <T extends A & B> void foo(T arg) {
  13.         arg.a();
  14.         arg.b();
  15.     }
  16.     public static void main( String ... args ) {
  17.         Mixed.foo( new C() );
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement