title: My java code is not returning expected output
body: <pre><code>public class Test1 {
      public static void main(String[] args) {
          int x = 0;
          while(x &lt; 1) {
              System.out.print("a");
              if(x &lt; 1)
                  System.out.print(" ");
  
              x = x + 2;
              if(x &gt; 1) {
                  System.out.println("noise");
                  x = x - 1;
              }
  
              if(x == 1)
                  System.out.println("annoys");
  
              if(x &gt; 0)
                  System.out.println("an");
  
              System.out.print("");
              System.out.print("oyster");
          }
      }
  }
  </code></pre>
  
  <p>I was writing this code to get the output as follows:</p>
  
  <pre><code>a noise
  annoys 
  an oyster
  </code></pre>
  
  <p>But after running my code it is printing "an" and "oyster" in different lines, I am a beginner in java, please help me and tell me why I am not getting the proper output.</p>