Hi,
While declaring objects of some classes, like FileInputStream, FileOutputStream, ObjectInputStream etc, we need to declare them in a try catch block. Otherwise we get exception saying Unhandled exception. One other way is to use throws exception with the method name in which we are declaring the object. For example:
public void myFunction() throws Exception{
FileInputStream f_in = new FileInputStream("C:\\myvector.data");
...
}
Which is the right way?
Thanks in advance.