ExamVeda
Login
Home
91
Which of these keywords are used for generating an exception manually?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
92
What will be the output of the following Java program?
class exception_handling 
{
    public static void main(String args[]) 
    {
        try 
       {
            int a, b;
            b = 0;
            a = 5 / b;
            System.out.print("A");
        }
        catch(ArithmeticException e) 
        {
      System.out.print("B");        	
        }
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
Which of the following is a super class of all exception type classes?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
94
At runtime, error is recoverable.
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
95
What will be the output of the following Java code?
class Myexception extends Exception 
{
int detail;
    Myexception(int a)
    {
        detail = a;
}
public String toString()
    {
  return "detail";
}
}
class Output 
{
    static void compute (int a) throws Myexception 
    {
   throw new Myexception(a);	 
}
public static void main(String args[]) 
    {
        try
        {
            compute(3);
        }
       catch(Myexception e)
       {
           System.out.print("Exception");
       } 
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
96
Which of these keywords is used to by the calling function to guard against the exception that is thrown by called function?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
97
What will be the output of the following Java code?
class exception_handling 
{
    public static void main(String args[]) 
    {
        try 
        {
            throw new NullPointerException ("Hello");
        }
        catch(ArithmeticException e)
        {
      System.out.print("B");        	
        }
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
98
Which of the following keyword is used by a calling function to handle exception thrown by a called function?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
99
Which of the following operators is used to generate instance of an exception which can be thrown using throw?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
100
Which of the following handles the exception when a catch is not used?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board