fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. /* Name of the class has to be "Main" only if the class is public. */
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. int[] i = new int[2];
  9. i[0] = 10;
  10. i[1] = 20;
  11. int n = 0;
  12. i[n+=1] = n;
  13. System.out.println("i[0] = " + i[0]);
  14. System.out.println("i[1] = " + i[1]);
  15. }
  16. }
Success #stdin #stdout 0.11s 320576KB
stdin
Standard input is empty
stdout
i[0] = 10
i[1] = 1