What will be the output of the following Java code snippet?
try (InputStream is = ...)
{
// do stuff with is...
}
catch (IOException e)
{
// handle exception
}
try (InputStream is = ...)
{
// do stuff with is...
}
catch (IOException e)
{
// handle exception
}A. Runtime Error
B. IOException
C. Compilation Error
D. Runs successfully
Answer: Option D

Join The Discussion