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. int arrayVal(int[] arr){
  11. arr[0]=0;
  12. arr[1]=1;
  13. arr[2]=2;
  14. arr[3]=3;
  15. arr[4]=4;
  16. return 9;
  17. }
  18. public static void main (String[] args) throws java.lang.Exception
  19. {
  20. // your code goes here
  21. int arr[] = new int[5];
  22. Ideone id = new Ideone();
  23. int a = id.arrayVal(arr);
  24. for(int i=0;i<5;i++){
  25. System.out.println(" "+arr[i]);
  26. }
  27. }
  28. }
Success #stdin #stdout 0.1s 320512KB
stdin
Standard input is empty
stdout
 0
 1
 2
 3
 4