class A{ } public class TestNestedGenerics{ ,C> void foo(T a,C b){} void m(){ TestNestedGenerics t = new TestNestedGenerics(); String str = new String(); A a = new A(); t.foo(a,str); } }