Include an interface from the same package (Java)

Posted by DashRantic on Stack Overflow See other posts from Stack Overflow or by DashRantic
Published on 2010-03-15T06:16:19Z Indexed on 2010/03/15 6:19 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

Hi,

I'm new to Java (C++ guy myself) and am trying to compile a simple program (testing different random number algorithms) in Java. I have an interface that I want to use to implement another class with, both of these items are in the same package.

So I have two files right now in my "Random" package directory--"RandomInterface.java" and "RandomTest1.java" (which implements RandomInterface). I can use javac to compile RandomInterface.java just fine, but I get the following error when I then try to compile RandomTest1:

RandomNew.java:3: cannot find symbol
symbol: class RandomClass
public class RandomNew implements RandomClass
                              ^
1 error

I declare both files to be part of the same package (Random) as the first line of each file. What do I need to do to include the RandomInterface class into the compile command for RandomTest1?

Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about javac