Original Post
I'm trying to create a simple Java project using more than one file. I ran the following and it worked, but is there a better way to do this?
********* FILE 1 ***************
public class File1
{
public static void main(String[] args)
{
System.out.println("Inside File1");
File2 f2 = new File2();
f2.display();
}
}
*********** FILE 2 *****************
public class File2
{
public File2()
{ }
public static void display()
{
System.out.println("Inside File2");
}
}
The output is:
Inside File1
Inside File2
Our teacher hasn't gotten as far as multiple files yet, and my Java books don't talk about them. Thanks.
[edited by - StonieJ on March 1, 2003 3:46:30 AM]