System.out.print is overlapping the questions why?
<p>My problem is when i run the program it runs all the System.out.print right but when i run
it for the second student some of it overlaps like so:</p>

<pre><code>"Enter the second student's name: Enter the student's score: "
</code></pre>

<p>instead of</p>

<pre><code>"Enter the second students's name: "

"Enter the student's score: "
</code></pre>

<p>I also can not input data into the System.out.print method of the second student</p>

<p>My main code where the error is:</p>

<pre><code>System.out.print("Enter the first student's name: ");
name = reader.nextLine();
student1.setName(name);
for (int i = 1; i &lt;= 3; i++){
    System.out.print("Enter the students's score: ");
    score = reader.nextInt();
    student1.setScore(i, score);
}

System.out.print("Enter the second student's name: "); //overlaps(stays on same line)
//also wont let me enter data here
name = reader.nextLine();
student2.setName(name);
for (int i = 1; i &lt;= 3; i++){
    System.out.print("Enter the students's score: "); //program skips to here to input
//data
    score = reader.nextInt();
    student2.setScore(i, score);
}
</code></pre>

<p>the part that deals with the error from the class is as follows</p>

<pre><code>public void setName(String nm){
    name = nm;
}
</code></pre>
