I am trying to grant one .java
file access to the class in another .java
file. I would like to do this on the command line. For example how would I do this using the two files below?
File: "ToImport.java"
package ABC;
public class ToImport {
private String aName;
public ToImport(String Name) {
aName = Name;
}
public String toString() {
return("Text: " + aName);
}
}
File: "TheImport.java"
package ABC;
public class TheImport {
public static void main(String[] args) {
ToImport abc = new ToImport("a");
System.out.println("TEST: " + abc);
}
}
When I type javac ToImport.java
I get no errors but when I type javac TheImport.java
I get the following error,