nextLine() Issues with java Scanner Class
<pre><code>import java.util.Scanner;

public class b {

    public static void main(String[] args){

        Scanner keyboard = new Scanner(System.in);
        String[] lines = new String[5];

        lines[0] = keyboard.nextLine();
        lines[1] = keyboard.nextLine();
        lines[2] = keyboard.nextLine();
        lines[3] = keyboard.nextLine();
        lines[4] = keyboard.nextLine();

        for (int i = 0; i &lt; lines.length; i++) {
            System.out.println(lines[i]);
        }
    }
}
</code></pre>

<p>Why does the above code not allow me to store the following:</p>

<pre><code>Hello there
How are you
My name is
Bill Gates
What is yours?
</code></pre>

<p>The output I get is:</p>

<pre><code>Hello there
How are you
My name is

Process completed.
</code></pre>

<p>I know there are issues with primitives and nextInt() but I thought nextLine() was supposed to address this.</p>
