Paste Search Dynamic
Recent pastes
toString list
  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 Main
  9. {
  10.         public static void main (string[] args) throws java.lang.exception
  11.         {
  12.         int x = 1;
  13.         int[] a = new int[2];
  14.        fun(x, a);
  15.        system.out.println(x + " " + arrays.toString(a));
  16.         x--;
  17.        a[1] = a.length;
  18.        fun(x, a);
  19.        system.out.println(x + " " + arrays.toString(a));
  20.     }
  21.  
  22.    public static void fun(int x, int[] list) {
  23.        list[x]++;  
  24.        x++;
  25.        system.out.println(x + " " + arrays.toString(list));
  26.  
  27.         }
  28. }
Parsed in 0.018 seconds