title: Compile while method is not returning any value
body: <p>As i am new to JAVA, trying with some concepts. Please look below 'test'code :</p>
  
  <pre><code>public class Test {
  
      public int a() {
           while (true);
  //         return 1;   
  
      }
  
      public static void main(String[] args) {
  
      }
  }
  </code></pre>
  
  <p><strong>Question :</strong>
  I am not sure why it gets compile successfully even the method a() is not returning any value?</p>