MCQ
Single Best Answer
Not Set
QWhat will be the output after the following program is compiled and executed?
public class Test{
public static void main(String args[]){
int x = 10;
x = myMethod(x--);
System.out.print(x);
}
static int myMethod(final int x){
return x--;
}
}
ID: #2122
Declaration and Access Control in Java
548 views
Question Info
#2122Q ID
Not SetDifficulty
Declaration and Access Control in JavaTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option B
Explanation
The program will lead to compilation error.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic