Add diamond expression
This commit is contained in:
parent
cd2f030ac6
commit
f3dc0cbeb7
@ -11,13 +11,13 @@ public final class TestClassWildcardsParamType<T1, T2> {
|
||||
}
|
||||
|
||||
public static <T1, T2> TestClassWildcardsParamType<T1, T2> of(T1 first, T2 second) {
|
||||
return new TestClassWildcardsParamType<T1, T2>(first, second);
|
||||
return new TestClassWildcardsParamType<>(first, second);
|
||||
}
|
||||
|
||||
public static void main(String[] agrs) {
|
||||
TestClassWildcardsParamType<Class<?>, String> pair = TestClassWildcardsParamType.of(List.class, "hello");
|
||||
|
||||
//Outout of compiler
|
||||
|
||||
//Output of compiler
|
||||
//TestClassWildcardsParamType<? extends Class<?>, String> pair = TestClassWildcardsParamType.of(List.class, "hello");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user