hi ,
* In the below code it will throw FileNotFoundException ...
* How can i get that Exception message as String from e.printStackTrace() method....
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
public class ExceptionMessage {
public static void main(String[] args) {
FileInputStream fil_inp;
try {
fil_inp = new FileInputStream(new File("D:/java/test.txt"));
System.out.println(fil_inp.available());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Thanks in advance,
JavaImran