if (btn == btnLoad) { try { booklist.clear(); BufferedReader reader = new BufferedReader(new FileReader("BOOKDATA.txt")); String line= reader.readLine(); Books ObjBook = new Books(); while(line!=null) { String[] ObjectArray =line.split(" "); Books BookObject=new Books(ObjectArray[0],ObjectArray[1],Double.parseDouble(ObjectArray[2]),Integer.parseInt(ObjectArray[3]),Integer.parseInt(ObjectArray[4]),ObjectArray[5],ObjectArray[6],ObjectArray[7]); booklist.add(BookObject); line = reader.readLine(); } reader.close(); } catch(EOFException eof) { System.out.println("End of file"); } catch(FileNotFoundException fnf) { System.out.println("File Not Found"); } catch(IOException error) { System.out.println("IO error"); } }
// short form Book oBook = new Book( value == null ? alternateValue:originalValue, args2, args3 );
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)