The work I have to do is make an application that allows us to open a file and make mark scores from it. But I dont understand how to input a file because of the code in my text book. Its very vauge in this subject and only has things like...
try (BufferedReader reader = new BufferedReader( new FileReader(" name of the file"));
What I dont understand is where all this goes and if the name of the file will directly open the text file.
Any help would be appreciated.
I personally like to use Scanner when reading files. I can read in the line with a scanner, then convert it to a oduble or use the string however I like for what i need to do. Look into the Scanner class.
String aFile = "thename";
Scanner in = new Scanner(new File(aFile))
//your code here
Hope that little code helps start you off
Edit - Oops, change aFIle to String not File ty pbl. My bad xD
This post has been edited by Fuzzyness: 20 April 2009 - 08:54 PM