Create an array with n copies of the same value/object?

后端 未结 7 1729
刺人心
刺人心 2020-12-16 11:29

I want to create an array of size n with the same value at every index in the array. What\'s the best way to do this in Java?

For example, if n

7条回答
提交回复
热议问题