How to add strings from one array into another array in Java

后端 未结 3 967
野性不改
野性不改 2020-12-22 12:28

I have an array of strings called initStrings and an array called squares. I need to take the strings from initStrings and add them one by one into different rows in the arr

3条回答
  •  太阳男子
    2020-12-22 13:11

    You cannot put those strings into an integer array. squares should be an array of string. If it were, you could do :

    squares[col][rows] = initStrings[(col * squares.length + rows) % initStrings.length];
    

提交回复
热议问题