File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 //it is a interface

above two java file are in the same directory.when I compile,it passed,then I comile,exist error one,[error] 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 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 it is ok.thanks
I agree. Here's the link:
subject: compile interface error
It's not a secret anymore!