作者H45 (!H45)
看板java
标题Re: [问题] 让两个矩阵串起来?
时间Thu Oct 23 23:00:40 2008
※ 引述《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
1F:→ H45:呃,不小心复制到 char 的,但是 int 的也有,请善用。 10/23 23:01