jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes compile interface error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compile interface error" Watch "compile interface error" New topic

compile interface error

qingwu wang
Ranch Hand

Joined: Feb 19, 2003
Posts: 147
Hello.java //it is a interface


above two java file are in the same directory.when I compile Hello.java,it passed,then I comile HelloWorld.java,exist error one,[error]
HelloWorld.java:cannot resolve symbol
symbol:class Hello
location:class HelloWorld
public class HelloWorld implemnets Hello
1 errors
but when I do it as following,compile well.

reslt rint dog
I dunno the reason.help me!

Thanks...qingwu<br />When I open my eyes,I see your pretty face.
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Do you have the current directory in your classpath when you compile and run it?
Richard Teston
Ranch Hand

Joined: Feb 12, 2002
Posts: 89
I think because you must have one public class or interface per source file
if you want your interface to be public you should place it on a different file named like your interface identifier, But if you want to put them on the same source file you must use default access modifier for your interface

The Code is the Programmer
qingwu wang
Ranch Hand

Joined: Feb 19, 2003
Posts: 147
Thanks David,Richard...
I forgot set current directory to classpath.now it is ok.thanks
I agree. Here's the link: http://aspose.com/file-tools
subject: compile interface error
jQuery in Action, 3rd edition