What does a tilde in angle brackets mean when creating a Java generic class?

前端 未结 4 810
醉酒成梦
醉酒成梦 2020-12-02 11:06

I was reading through some JMockit examples and found this code:

final List actualItems = new ArrayList<~>();

What d

4条回答
  •  天涯浪人
    2020-12-02 11:14

    I think that is shorthand to mean whatever the type is, in this case OrderItem.

提交回复
热议问题