Creating an array while passing it as an argument in Java

后端 未结 4 692
没有蜡笔的小新
没有蜡笔的小新 2020-12-18 19:09

Is there a way to create an array of objects as part of a constructor or method? I\'m really not sure how to word this, so I\'ve included an example. I have an enum, and

4条回答
  •  长情又很酷
    2020-12-18 19:48

    Is there a way you can pass an array without creating an array?

    No, but you could use varargs to make it mostly-invisible, although that int at the end might need to move.

提交回复
热议问题