title: Scanner Happy Numbers Java
body: <p>Can't understand one thing in below code, hope someone might help:</p>
  
  <pre><code>public class Solution {
  
    public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      int N = in.nextInt();
      int count = 0;
  
      for (int i = 0; i &lt; N; i++){
        if (in.nextInt() % 7 == 0){
          count++;
        }
      }
      System.out.printf("%d", count);
    }
  
  }
  </code></pre>
  
  <p>How does the <code>Scanner</code> exactly works? I thought this code will only expect 1 input from the keyboard, but what it does is taking 1st number as a length of the array and afterwards gives me a chance to enter those values.  </p>
  
  <p>For instance, if I enter 3, then I'll be able to add 3 elements, if 6 then 6 and so on. But I can't see no array in this code.<br>
  Maybe I'm missing something with the for loop?</p>