Creating a new ArrayList in Java

后端 未结 9 1741
执念已碎
执念已碎 2021-02-05 00:31

Assuming that I have a class named Class,

And I would like to make a new ArrayList that it\'s values will be of type Class.

My question

9条回答
  •  误落风尘
    2021-02-05 00:51

    You're very close. Use same type on both sides, and include ().

    ArrayList myArray = new ArrayList();
    

提交回复
热议问题