Ask Experts Questions for FREE Help !
Ask
    bestmaster99's Avatar
    bestmaster99 Posts: 1, Reputation: 1
    New Member
     
    #1

    Jun 3, 2014, 02:38 AM
    Null Point Exception
    I have problem trying to figure what is wrong with the null point exception. My codes seems to be looking logically fine. As least to me? I am trying to read the content of a text document line by line.
    Here's my code:
    public void readFile() throws IOException {
    BufferedReader in = new BufferedReader(new FileReader("C:/Users/Admin/Dropbox/JiaWei/Advance Java Programming/Practical/studentData.txt"));


    while (in.readLine() != null) {


    String[] studentData = in.readLine().split(",");


    students.add(new Student(studentData[0], Double.parseDouble(studentData[1]), Integer.parseInt(studentData[2])));
    }


    }
    Here is the content of the text file:
    A,3.6,100
    B,3.6,50
    C,3.9,10
    D,3.2,80
    E,2.9,100

Check out some similar questions!

Exception [ 1 Answers ]

Try block is possible inside the catch block in java

The exception unknown software exception (0xc0000409) occurred in the application at [ 2 Answers ]

the exception unknown software exception (0xc0000409) occurred in the application at location 0x5b86a3c0

Find the components of the vector v with given point P and terminal point Q, [ 1 Answers ]

Find the components of the vector v with given point P and terminal point Q, find te unit vector in the direction of v. 1. p: (3.2.0) Q: (5, -2,0)


View more questions Search
 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.