How do I return an array of objects in java?

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

How do I return an array of objects in java?

7条回答
  •  旧巷少年郎
    2021-01-03 06:06

    What is the data structure that you have?

    • If it is an array - just return it.
    • If it is a Collection - use toArray() (or preferably toArray(T[] a)).

提交回复
热议问题