java - Null Pointer Exception with objectinputstream -
this question has answer here:
- what nullpointerexception, , how fix it? 12 answers
i'm trying read list of names , phone numbers in. the program keeps throwing nullpointerexception. why doing this?
int i=0; datab[] b = null; //b = null; // name of file open. string filename = "datt.dat"; try { // use reading data. byte[] buffer = new byte[1000]; fileinputstream fileis = new fileinputstream("datt.dat"); objectinputstream input = new objectinputstream(fileis); for(i=0; i<b.length; i++) b[i]=(datab)input.readobject(); input.close();
b null, b.length throws exception
Comments
Post a Comment