Re: [問題] 讓兩個矩陣串起來?

看板java作者 (!H45)時間17年前 (2008/10/23 23:00), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《kira770927 (楓沁舞)》之銘言: : 請問各位高手 : 現在我有一個 int [] a {1,2,3} : int [] b {2,4,6} : 我想讓 int c [] 變成是 int [] a + int [] b : 就是 int c [1,2,3,2,4,6] : 這樣可能實現嗎? Apache Commons Lang 2.4 public class ArrayUtils extends java.lang.Object public static char[] addAll(char[] array1, char[] array2) Description: Adds all the elements of the given arrays into a new array. The new array contains all of the element of array1 followed by all of the elements array2. When an array is returned, it is always a new array. ArrayUtils.addAll(array1, null) = cloned copy of array1 ArrayUtils.addAll(null, array2) = cloned copy of array2 ArrayUtils.addAll([], []) = [] Parameters: array1 - the first array whose elements are added to the new array. array2 - the second array whose elements are added to the new array. Returns: The new char[] array. Since: 2.1 http://commons.apache.org/ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.116.247.13

10/23 23:01, , 1F
呃,不小心複製到 char 的,但是 int 的也有,請善用。
10/23 23:01, 1F
文章代碼(AID): #19096PyG (java)
文章代碼(AID): #19096PyG (java)