Why the print new line doesnt work?
<p>I started to learn Java and I build this code from a book. This is the code in Java:</p>

<pre><code>public class MyFirstApp {
    public static void main (String[] args) {
        int x = 1;
        while (x&lt;3){
            System.out.print("Doo"+x);
            System.out.print("Bee");
            x=x+1;
        }
        if (x==3){
            System.out.println("Do"+x);
        }
    }
}
</code></pre>

<p>Why the output is:</p>

<pre><code>Doo1BeeDoo2BeeDo3
</code></pre>

<p>instead of</p>

<pre><code>Doo1BeeDoo2Bee
Do3
</code></pre>
