-
What is the output of this program?
import java.io.*;
public class filesinputoutput_Example
{
public static void main(String args[])
{
InputStream obj = new FileInputStream("inputoutput.java");
System.out.print(obj.available());
}
}
-
- Compilation error
- Runtime error
- true
- false
- None of these
Correct Option: A
filesinputoutput.java:6: error: unreported exception FileNotFoundException; must be caught or declared to be thrown
InputStream obj = new FileInputStream("inputoutput.java");
^
filesinputoutput.java:7: error: unreported exception IOException; must be caught or declared to be thrown
System.out.print(obj.available());
^
2 errors