When choosing the input file, I tried three ways & all of them generated errors !
I created the file.txt in the project's folder. I'm using Netbeans IDE.
1) Passing
java ShowFile Input.text
as a command-line argument [properties ---> run ---> wrote this command-line in the 'Argument' box]
2) Using the file's path....
File file = new File("C:\\Users\\TOSHIBA\\My Documents\\NetBeansProjects\\fin.txt");
3) Creating an instance of the file...
java.io.File file = new java.io.File("fin.txt");
This first one gave... "File Not Found" error. //FileNotFoundException
The second two gave... "Usage: ShowFile File" error. //ArrayIndexOutOfBoundsException
What's wrong with it?!
Thanks.