Java - Exceptional Handling

page 1 out of 3

page 1 out of 3


Question 1     

What is class of Java Exception Class?






Question 2     

What is the output of the above code?

class Test 
{
    public static void main(String args[]) 
    {
        try 
        {
            System.out.print("Java is easy" + " " + 100 / 0);
        }
        catch(Exception e) 
        {
        	System.out.print("to learn");        	
        }
    }
}






Question 3     

Which of the following is not a RunTimeException?






Question 4     

Which of the following is not part of Exception handling?






Question 5     

Which keyword can be used to throw an exception manually?







Question 6     

In which of the following package Exception class exist?






Question 7     

What is the output of the following code?

class Main
{
public static void main(String args[])
	{
		try
		{
			int a, b;
			b = 0;
			a = 5 / b;
			System.out.print("The");
		}
		catch(ArithmeticException e)
		{
			System.out.print("Inquisitive");
		}
	}
}





Question 8     

What is the output of the following code?

class Main
{
public static void main(String args[])
	{
		try
		{
			int a, b;
			b = 0;
			a = 5 / b;
			System.out.print("The");
		}
		catch(ArithmeticException e)
		{
			System.out.print("Inquisitive");
		}
                finally{
                        System.out.print("Executed");
                }
	}
}






Question 9     

What is the output of the following code?

class Check extends Exception { }
  
public class Main {
   public static void main(String args[]) { 
      try {
         throw new Check();
      }
      catch(Check t) {
         System.out.println("Exception Throwed");
      }
      finally {
         System.out.println("inside finally ");
      }
  }
}





Question 10     

What is the output of this program?

public class Test
{
	public static void main(String[] args)
	{
		try
		{
			return;
		}
		finally
		{
			System.out.println( "inside finally" );
		}
	}
}




page 1 out of 3

page 1 out of 3


Sign Up Page

Oops!!

To view the solution need to Login



Score : 0 / 0
L
o
a
d
i
n
g
.
.
.