文本文件  |  17行  |  333 B

class Main {
	
	class Foo { }
	
	interface GenericBase <F> { }
	
	class GenericDerived <F extends Foo> implements GenericBase<F> { }

	private <B extends Foo> void foo(GenericBase<B> g) { }
	
	private <D extends Foo> void foo(GenericDerived<D> g) { }
	
	void bar() {
		GenericDerived<Foo> gd = new GenericDerived<>();
		foo(gd);
	}
}