Any use of the type-parameter in a static context is forbidden. Type parameter can NOT be used as:
- The type of static field (line 2);
- The type of the return value of the static method;
- The type of the formal parameter of the static method (line 6);
- The type of a local variable in the body of the static method (line 7);
- The type of a local variable in the static initialization block, etc.
In addition, the type parameter can not be used in the operator new, even when creating arrays (line 2).
Login in to like
Login in to comment