Why is first for loop iteration skipped?
<p>my code is yielding an unexpected result. It seems my for loop skips the first iteration and I don't understand why. </p>

<pre><code>public static void main(String[] args) {

    Scanner get = new Scanner(System.in);
    int number;

    // Ex.1.

    String family_name;
    String[] family_array;

    System.out.println("Enter number of family members: ");
    number = get.nextInt();
    family_array = new String[number];

    for(int i = 0; i &lt; number; i++){
        System.out.println("Enter family member name: ");
        family_name = get.nextLine();
        family_array[i] = family_name;
    }

    for(int i = 0; i &lt; number; i++){
        System.out.println(family_array[i]);
    }

}
</code></pre>

<p>Returns... (pretend the number input are names)</p>

<pre><code>Enter number of family members: 
5
Enter family member name: 
Enter family member name: 
1
Enter family member name: 
2
Enter family member name: 
3
Enter family member name: 
4

1
2
3
4
</code></pre>

<p>Why is the first get.nextLine() skipped?</p>
