If you have all the classes in one file like file.java then all the classes will compile into their respective class files. So for example if you had your Main.java file with this:
PHP Code:
import java.io.*;
class Main{
public static void main(String args[]) throws IOException{
String name;
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
System.out.print("What is this new person's name: ");
name = stdin.readLine();
Person person = new Person(name);
System.out.println("A new person was created with the name " + person.getName());
}
}
class Person{
private String name;
public Person(String name){
this.name = name;
}
public String getName(){
return name;
}
}
Now when you compile Main.java you will notice that you end up with two files Main.class and Person.class.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Well you don't have to know the order of the classes. Java handles all that. Ok then download some free java ide that has a feature for creating projects and will allow you to just compile everything in the project then just add all the java files to the project.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
You wouldn't be compiling more than one java file. As I showed in my first post all the classes are in the same java file. Then you compile just that one java file. Java will figure out where everything is at.
Anyways just download some free java ide as I mentioned and do it that way. JCreator is a popular one.