FileInputStream:
FileInputStream is used to open a file for reading.
FileInputStream fis=new FileInputStream("welcome");
It checks whether the file exists or not, if the file exists, opens the file for reading, otherwise a FileNotFoundException will be thrown.
ObjectInputStream:
FileInputStream fis=new FileInputStream("welcome");
ObjectInputStream ois=new ObjectInputStream(fis);
It opens a file for reading an object.
source
share