Q101
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
115
Questions
6/6
Page
Pick an option on a question to see the right answer and solution.
Q101
Open questionSelect an option to see the answer and solution.
Q102
Open questionSelect an option to see the answer and solution.
Q103
Open questionSelect an option to see the answer and solution.
Q104
Open questionSelect an option to see the answer and solution.
Q105
Open questionclass 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");
}
}
}Select an option to see the answer and solution.
Q106
Open questionSelect an option to see the answer and solution.
Q107
Open questionSelect an option to see the answer and solution.
Q108
Open questionSelect an option to see the answer and solution.
Q109
Open questionclass 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");
}
}
}Select an option to see the answer and solution.
Q110
Open questionclass 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);
}
}Select an option to see the answer and solution.
Q111
Open questionclass 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");
}
finally
{
System.out.print("C");
}
}
}Select an option to see the answer and solution.
Q112
Open questionpublic class A
{
public static void main(String args[])
{
try
{
System.out.print("Hello world ");
}
finally
{
System.out.println("Finally executing ");
}
}
}Select an option to see the answer and solution.
Q113
Open questionclass exception_handling
{
public static void main(String args[])
{
try
{
System.out.print("Hello" + " " + 1 / 0);
}
catch(ArithmeticException e)
{
System.out.print("World");
}
}
}Select an option to see the answer and solution.
Q114
Open questionSelect an option to see the answer and solution.
Q115
Open questionSelect an option to see the answer and solution.