Creating a new ArrayList in Java

后端 未结 9 1743
执念已碎
执念已碎 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 01:14

    Material please go through this Link And also try this

     ArrayList<Class> myArray= new ArrayList<Class>();
    
    0 讨论(0)
  • 2021-02-05 01:16

    You can use in Java 8

    List<Class> myArray= new ArrayList<>();
    
    0 讨论(0)
  • 2021-02-05 01:18

    Fixed the code for you:

    ArrayList<Class> myArray= new ArrayList<Class>();
    
    0 讨论(0)
提交回复
热议问题