can I do this, throwing fnfe exception on class constructor?
I have been trying to think of the best way to implement a MyFile_IO class.
And would like to send the filename to the class when invoked as an object, and for the class to test if the file exists, But I am unsure as to the extent of exception handling. Do throws run checks or do they simply sit there and only work if the VM stumbles across the errors. Ok my code might make some more sense of what I am trying to accomplish.
So basically simply setting of a filename to a method, will throwing FileNotFoundException check to see if the file exists? or will i need to create a new Scanner(new File( fileName )) for the actual exception handling (checking to see if case exists) to take place?
public class My_FileIO
private String fileName;
public My_FileIO( String fName) throws FileNotFoundException
setFileName( fName );
public void setFileName( String fileName )
public String getFileName() ...
public void openFile() ...