Hello,
I am beginner in Java, my work is to extract data from a text-only files file this form:
0 1 1 1 0 0 0
1 0 1 0 1 0 1
etc.....
I store each line of the file in a ArrayList
Here is my code.
Code:
for(int i =0; i <= NUMBER_OF_LINES; i + +){
ArrayList <Integer> v = new ArrayList <Integer>();
ln = br.readLine();
ln = ln.trim();
StringTokenizer st = new StringTokenizer(row," ");
while(st.hasMoreTokens())
{
v.add(Integer.parseInt(st.nextToken()));
System.out.System.out.println(v);
}
This code takes me back the following exception:
Code:
java.lang.NullPointerException
Does someone can help me? I want to know if I'm on the right track.
Bookmarks