title: Why does Eclipse generate .class file if there is a syntax error in my Java source file?
body: <p>When I am creating my project using the Eclipse IDE it is generating a class file even when there is a syntax error in my code? </p>
  
  <pre><code>class Test {    
      public void test(String value) {
          System.out.println("TEST CALLED WITH VALUE " + value);
      }
  }
  
  class Abc {
      Test obj = new Test();      
      public String firstCallToMethodFromTest() {
          System.out.println("FIRST CALL TO THE METHOD FROM TEST CLASS");
          String result = obj.test("TEST");
          return result;
      }
  
      public String secondCallToMethodFromTest() {
          System.out.println("SECOND CALL TO THE METHOD FROM TEST CLASS");
          String result = obj.test(); 
          // There is no such method in test class i.e source code error
          return result;
      }       
  }
  </code></pre>
  
  <p>Method <code>firstCallToMethodFromTest</code> is called as an action method from my Struts action. How does Eclipse make it possible to compile code for the <code>Abc</code> class where there are syntax errors in my source code file?</p>