Java generic field declaration

后端 未结 5 770
天命终不由人
天命终不由人 2021-01-11 12:01

In a class without generic types I want to declare a rather complex generic field similar to these:

public class Client {
    private Map

        
5条回答
  •  终归单人心
    2021-01-11 12:39

    You can't. Your only option is to declare the generic type parameters in your Client class declaration. If your Client class has no generic type parameters, its members can't be generic. You must use actual types in the declaration of your class members.

提交回复
热议问题