Hi all,
In my project I have several classes. In some of my classes, I have to use an instances of my other classes. When I compile my class, which has a reference to another classe, it gives me an error. like this.
C:\MyProject>javac SomeClass.java
SomeClass.java:9: cannot resolve symbol
symbol : class AnotherClass
location: class MyProject.SomeClass
public SomeClass (AnotherClass as) {
For example I have the following class.
import java.io.*
// other imports
public class SomeClass {
public SomeClass(AnotherClass ac) {
this.as = as;
}
private someMethod () {
}
private AnotherClass ac = new AnotherClass();
}
and here's the my AnotherClass.
import java.io.*;
// other imports
public class AnotherClass {
public AnotherClass () {
{
private someMethod () {
}
}
All my classes are under the same package
C:\MyProject\SomeClass.java
C:\MyProject\AnotherClass.java
and so on....
So, How do I need to include the package? Or if I need to include the package? Can some one please suggest.
Thanks.