aspose file tools*
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 Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "compile interface error" Watch "compile interface error" New topic
Author

compile interface error

qingwu wang
Ranch Hand

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

[hr]
HelloWorld.java

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
[/error]
[hr]
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
Rancher

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