Kev Woo wrote:If I try to run the program without giving the file name through the command line, I get the OutOfBounds error which prevents me from using the interactive portion.
I'm assuming this happens when your program tries to access the variable args[0], which doesn't exist if no command line arguments were supplied when the program was invoked. All you need to do is check args.length first to see if any arguments are present. This is probably something your command-line version should do anyway, since dying with an array index out of bounds exception is a rather ungraceful way for a program to exit if the user forgets to type in the argument(s).