You are not logged in.
- Index
- » Quiz Questions
- » Class Test:
- 0
Pages:: 1
#1 2015-06-10 10:32:06
Class Test:
Directions:
Class Test
{
public static void main(String [] args) throws Exception
{
try{
test();
}catch (IOException e) {
System.out.println("IOException thrown");
}catch(Exception e)
{
System.out.println("Exception thrown");
}
}
public static void test()
{
throw new IOException();
}
}
Question:
What would be the result?
Option A):
The code will not compile
Option B):
The output is Exception
Option C):
The program will run normarlly
Option D):
The output is IOException thrown
Correct Answer is Option A):
The code will not compile
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-10 10:32:06
- Advertisement
- Ads By Google
Re: Class Test:
\n
Pages:: 1