Multiple Choice Question

Quiz Guidelines

 

QID: 
33
Tags: 
Validated against: 
java8
Question: 

Given:

public class ExceptionCheck {
	
	static int i = 10;
	
	public static void main (String[] argds)
	{
		System.out.println(myMethod());
		System.out.println(i);
	}
	
	public static int myMethod()
	{
		try{
			throw new Exception();
		}
		catch(Exception e)
		{
			return i;
		}
		finally{
			i = 12;
            return i;
		}
        return i;
	}
}

 

Select 1 option

A. Compilation Fail

B. Print 10 and 12.

C. Print 10 and 10.

D. Print 12 and 12.

Q&A Set: 

Search the Web

Custom Search

Searches whole web. Use the search in the right sidebar to search only within javajee.com!!!