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.  
  11. public static void array() {
  12. int array_variable[]=new int[10];
  13. for(int i=0;i<10;++i) {
  14. array_variable[i]=i/2;
  15. array_variable[i]++;
  16. System.out.print(array_variable[i]);
  17. i++;
  18. }
  19. }
  20. public static void main (String[] args) throws java.lang.Exception
  21. {
  22. array();
  23.  
  24. }
  25. }
  26.  
Success #stdin #stdout 0.08s 54632KB
stdin
class array_output 
{
    public static void main(String args[]) 
    {
        int array_variable [] = new int[10];
  for (int i = 0; i < 10; ++i) 
        {
            array_variable[i] = i/2;
            System.out.print(array_variable[i] + " ");
            i++;
        }
    } 
}
stdout
12345