ExamVeda
Login
Home
1
Which of these handles the exception when no catch is used?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
Which of these methods is used to print stack trace?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
3
Which of these keywords is used to generate an exception explicitly?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
4
Which of these clause will be executed even if no exceptions are found?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
5
What will be the output of the following Java code?
class Output 
{
    public static void main(String args[]) 
    {
       try 
       {
           int a = 0;
           int b = 5;
           int c = b / a;
           System.out.print("Hello");
       }
       catch(Exception e) 
       {
           System.out.print("World");
       } 
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
6
What exception thrown by parseInt() method?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
7
A single try block must be followed by which of these?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
8
Which of these methods return description of an exception?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
9
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(DevideByZeroException e)
       {
           System.out.print("Exception");
       } 
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
10
What will be the output of the following Java program?
class exception_handling 
{
    public static void main(String args[]) 
    {
        try 
        {
            int i, sum;
            sum = 10;
            for (i = -1; i < 3 ;++i)
                sum = (sum / i);
        }
        catch(ArithmeticException e) 
        {
      System.out.print("0");        	
        } 
        System.out.print(sum);
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board