java - Null Pointer Exception with objectinputstream -


this question has answer here:

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

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -