Here you can find the source of addArray(Object[][] first, Object[][]... more)
public static Object[][] addArray(Object[][] first, Object[][]... more)
//package com.java2s; /************************************************************************************** * Copyright (C) 2008 EsperTech, Inc. All rights reserved. * * http://esper.codehaus.org * * http://www.espertech.com * * ---------------------------------------------------------------------------------- * * The software in this package is published under the terms of the GPL license * * a copy of which has been included with this distribution in the license.txt file. * **************************************************************************************/ public class Main { public static Object[][] addArray(Object[][] first, Object[][]... more) { int len = first.length; for (int i = 0; i < more.length; i++) { Object[][] next = more[i]; len += next.length;/*from w ww . j a va 2 s.c o m*/ } Object[][] result = new Object[len][]; int count = 0; for (int i = 0; i < first.length; i++) { result[count] = first[i]; count++; } for (int i = 0; i < more.length; i++) { Object[][] next = more[i]; for (int j = 0; j < next.length; j++) { result[count] = next[j]; count++; } } return result; } }