Advertisement
enissay

Enissay

Oct 10th, 2014
214
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         String[] arrayA = {"AA", "AB", "AC"};
  3.         String[] arrayB = {"B1", "B2", "B3", "B4"};
  4.         String[][] arrayC;
  5.        
  6.         arrayC = new String[arrayA.length][arrayB.length];
  7.        
  8.         for (int i = 0; i < arrayA.length; i++) {
  9.             arrayC[i][0] = arrayA[i];
  10.             System.arraycopy(arrayB, 0, arrayC[i], 1, arrayB.length); // => ERROR: java.lang.ArrayIndexOutOfBoundsException
  11.     }
Advertisement
RAW Paste Data Copied
Advertisement