Changes in access of variables for generic classes in Java 7

后端 未结 3 939
借酒劲吻你
借酒劲吻你 2021-01-01 18:03

Here is a simple example of some code that compiles using Java 6, but does not compile in Java 7.

public class Test {

  private final         


        
3条回答
  •  死守一世寂寞
    2021-01-01 18:54

    See @pingw33n's comment for the answer, but the way to fix this is to remove the generic parameters on the nested class. Unless you have a use case where the inner and outer T's can be different, they are redundant. All they are doing is causing this grief.

提交回复
热议问题