overlord20
Gawd
- Joined
- Feb 5, 2010
- Messages
- 623
I am trying to figure out how to do file input in a Class instead of main.
Used the above if statement above when I input the file into Main. But I want to do the file input in a Class now if it is even possible. I did a lot of searching and haven't found anything on the matter.
Help is appreciated.
Code:
if ( args.length != 2 )
{
System.out.print("Enter input file name: ");
infilename = scan.nextLine();
System.out.print("Enter output file name: ");
outfilename = scan.nextLine();
}
else
{
infilename = args[0];
outfilename = args[1];
}
Used the above if statement above when I input the file into Main. But I want to do the file input in a Class now if it is even possible. I did a lot of searching and haven't found anything on the matter.
Help is appreciated.