Community
Participate
Working Groups
note: I am using Java SDK 1.4.0_01 compiling this test, TestInterface.java causes the error "This method has a constructor name" This compiles fine with javac. contents of TestInterface.java: ============================================================ public interface TestInterface { public void TestInterface(); } ============================================================ This version with a genuine constructor name generates the same eclipse error "This method has a constructor name". (note the removal of the void return argument) ============================================================ public interface TestInterface { public TestInterface(); } ============================================================ javac generates this error: TestInterface.java:10: <identifier> expected public TestInterface(); -Kevin
public interface TestInterface { public void TestInterface(); } ---> method has constructor name This is only a warning, and you can turn it off in the compiler preferences (Window>Preferences>Java>Compiler>Errors and Warnings>Methods with constructor name). By default, the warning is on, since this is generally not intentional and rather misleading. public interface TestInterface { public TestInterface(); } ---> interface cannot have constructor. I don't see a problem with this error. Given it has no return type, this declaration would be a constructor (with no actual body). Why is this a problem for you ?
Closing, please reopen if you think we should not report an error.