Home

Java Programming MCQ Question with Answer

Java Programming MCQ with detailed explanation for interview, entrance and competitive exams. Explanation are given for understanding.

Download Java Programming MCQ Question Answer PDF

Question No : 43
Which javadoc tag is used to denote a comment for methods parameters?

@method
@parameter
@argument
@param

Question No : 44
Which of the following command lines options generates documentation for all classes and methods?

-protected
-public
-private
-encoding

Question No : 45
Which of the following represent legal flow control statements?

break;
break();
continue(inner);
all of the above

Question No : 46
Consider the following code snippet:

try 
{
int x=0; int y=50/x;
System.out.println("Division by zero");
}
catch(ArithmeticException e)
{
System.out.println("catch block");
}

What will be the output?

Error. Won't compile
Division by zero
Catch block
Division by zero catch block

Question No : 47
Which of the following represent legal flow control statements?

break();
continue(inner);
return;
exit();

Question No : 48
The name of a Java program file must match the name of the class with the extension Java.

True
False

Question No : 49
Two methods cannot have the same name in Java.

True
False