How do I return an array of objects in java?

后端 未结 7 606
情书的邮戳
情书的邮戳 2021-01-03 05:15

How do I return an array of objects in java?

相关标签:
7条回答
  • 2021-01-03 06:12

    try this

    public ArrayList<ObjectsType> fName(){
       ArrayList<ObjectsType>objectsList=new ArrayList<>();
       objectList.add(objets);
       return objectList;
    }
    
    0 讨论(0)
提交回复
热议问题