fork download
  1. import java.util.Arrays;
  2.  
  3. public class Main {
  4. // WhileExample
  5.  
  6. public static void main (String[] args) {
  7. int i = 0;
  8. int[] array = new int[10];
  9. while (i < array.length) {
  10. array[i] = i;
  11. i++;
  12. }
  13. System.out.println(Arrays.toString(array));
  14.  
  15. }
  16. }
Success #stdin #stdout 0.07s 54564KB
stdin
Standard input is empty
stdout
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]