fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int[] a = {2,3,4};
  13. int[] b = {0,1};
  14. int[] c = {1,5,2,7};
  15. int[][] arrays = {a,b,c};
  16.  
  17. for(int i = 0; i < arrays.length;i++)
  18. {
  19. for(int j = 0; j < arrays[0].length;j++)
  20. {
  21. System.out.print(arrays[i][j]+",");
  22. }
  23. System.out.println();
  24. }
  25. }
  26. }
Runtime error #stdin #stdout #stderr 0.05s 711168KB
stdin
Standard input is empty
stdout
2,3,4,
0,1,
stderr
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
	at Ideone.main(Main.java:21)