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={
  13. {1,33,32,56,45},
  14. {2,77,33,68,45},
  15. {3,43,55,43,67}
  16. };
  17. int [] B={4,12,16,10,14};
  18. int sum=0;
  19. for(int i=0;i<4;i++){
  20. for(int n=1;n<5;n++)
  21.  
  22. System.out.print(A[i][n]+",");
  23. }
  24. System.out.println();
  25. System.out.print("1Total sales amount=");
  26.  
  27. }
  28. }
  29.  
Runtime error #stdin #stdout #stderr 0.08s 33944KB
stdin
Standard input is empty
stdout
33,32,56,45,77,33,68,45,43,55,43,67,
stderr
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
	at Ideone.main(Main.java:22)