Just place both the class file in the same directory. For example lets say you want to use the Student class object in the Test class, You will first compile the Student.java , the Student.class will be generate then place Student.class in the same directory where you have Test.java , then you will compile Test.java and Test.class file will be generated. You can run Test which has the main method.
Sponsored Links