Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface A {
- void a();
- }
- interface B {
- void b();
- }
- class C implements A, B {
- public void a(){System.out.println("a");}
- public void b(){System.out.println("b");}
- }
- class Mixed {
- public static <T extends A & B> void foo(T arg) {
- arg.a();
- arg.b();
- }
- public static void main( String ... args ) {
- Mixed.foo( new C() );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement