You are welcome and yes they are a vital source of information.
Type: Posts; User: Kewish
You are welcome and yes they are a vital source of information.
Do you what whitespace in your text file?
I.E. blank lines
Post your completed code along with any exceptions you get in the console or other output.
Create the File Object first. Then the Scanner with your newly created File object. Forget about DataInputStream. You will be using the Scanner.
--- Update ---
Here's a post from our very own...
args is the array of command line arguments.
args [0] is a value from the array. And the datatype is a String.
Can you constuct a File object with that information? Yep.
Yep and what is args [0]???
Not InputStream itself, what did you pass to it rather?
What does File take in the contructor? Read here File Class - Constructor
What is args[0]??
Excellent.
You can still use your command line argument. How did you do it in your original code? What datatype does the File constructor take? What datatype is the command line arg?
Do you have to use DataInputStream/FileInputStream? The Scanner class will suffice for your purpose Scanner Class - API
Write down the steps you think your program would have to take to achieve...