If these two files are in the same folder you don't have to do anything. Here's a rough example:
Code:
C:\david\docs\forums\import>ls *.java
A.java B.java
As you can see I have A.java and B.java in the same folder. Here is the contents of B.java:
Code:
public class B {
public B() {
}
public String input(String message) {
return "User's Input";
}
}
...and here is A.java:
Code:
public class A {
private B b;
public A() {
b = new B();
String userInput = b.input("What is your favouriate colour?");
}
}
Because these two files are in the same folder (and they don't use package statements) there is no need to use an 'import' statement.
Bookmarks