title: How to use "for each" in java to get input?
body: <p>I'm a beginner in java. I have question about for each.
  can I use it in order to get input from user?
  If yes, How? </p>
  
  <p>I tried this code, but didn't work:</p>
  
  <pre><code>Scanner scanner = new Scanner(System.in);
  int[] arr = new int[3];
  for(int m: arr){
      m = scanner.nextInt();
   }
  //arr[0] = 1 , arr[1] = 5 , arr[2] = 61
  </code></pre>
  
  <p>But when I printed my array:<br>
  0 0 0<br>
  was shown.</p>