当我使用
Eclipse IDE创建项目时,即使我的代码中存在语法错误,它也会生成一个类文件?
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;
}
}
方法firstCallToMethodFromTest被我的Struts动作调用为动作方法. Eclipse如何为我的源代码文件中存在语法错误的Abc类编译代码?