Advertisement
vangivang

load() Method

Jun 22nd, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. public void load()
  2.     {
  3.         try
  4.         {
  5.             FileInputStream file = new FileInputStream("bank.data");
  6.             ObjectInputStream readThisFile = new ObjectInputStream(file);
  7.            
  8.             //The follow line is marked with a yellow warning:
  9.             //Type safety: Unchecked cast from Object to List<Client>
  10.             //What does it mean?   
  11.        
  12.             clients = (List<Client>)readThisFile.readObject();     
  13.            
  14.             readThisFile.close();
  15.         }
  16.         catch (Exception e)
  17.         {
  18.             e.getMessage();
  19.             clients = new ArrayList<Client>();
  20.         }
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement