Java
Programming and Technical
Programming
Program
Predict the output
import java.io.IOException;
public class Exception1{
public static void main(String[] args)
{
try
{
throw new IOException();
}
catch(IOException | Exception ex)
{
System.out.println(ex + " handled ");
}
}
}
A. program won't compile
B. runtime exception
C. program will compile
D. None of the above
Read Solution (Total 2)
-
- C. program will complie
- 2 years agoHelpfull: Yes(0) No(1)
- The output of the program will be "java.io.IOException handled" so answer should be (C)
- 1 year agoHelpfull: Yes(0) No(1)
Java Other Question