Initialize List> in Java

前端 未结 3 543
一个人的身影
一个人的身影 2021-01-31 00:09

How can I initialize List> in Java?

I know List is an interface and I can use ArrayList or Linked

3条回答
  •  清酒与你
    2021-01-31 00:33

    You can define it as List> list = new ArrayList>();.

    Then while defining the inner List you can take care of initialising it as ArrayList.

提交回复
热议问题