Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
Java programming help
Name: priti Date: February 24, 2004 at 17:42:36 Pacific OS: win 2000 CPU/Ram: p3
Comment:
Hi, I'm trying to read file in java which contains blank lines in between.
I tried this one:
BufferedReader infile = new BufferedReader(new FileReader(file)); try { // while ((i = infile.read()) != -1){ while ( (inLine = infile.readLine()) != null) { System.out.println(inLine); st = new StringTokenizer(inLine); ......} File contains following format: # dfafjk;kj #;dfdjjk
#ldhldfdf Abcedef #
#### Bye!
I want to read whole file. When I try with above logic it gives me nullpointerexception after second line. I want to go upto last line(Bye!). So, my question is how can I read with text file with blank lines? Thanks for help and time.
Summary: Hello, I have to create java program using Array, which my teacher said would be a lot easier. However, I am not sure how to write this, as I am a newbie at java. Could someone please help me with thi...
Summary: Simulation - A virtual student taking midterm test. A virtual student takes a test that has 8 true/false questions, and the probabilities of his/her answering the questions right are: 81%, 30%, 95%, 1...
Summary: Hi all, Im taking course intro to java programming and Im having problem w/ my program. I suppose to get an average number from three input number but I dont get the right result. For instance, i put...