Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 26th, 2010  |  syntax: Java  |  size: 0.35 KB  |  views: 74  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }