- A The will compile successfully and display 9 as output.
- B The program will lead to compilation error.
- C The program will lead to runtime error.
- D The program will compile successfully and display 10 as output.
Java Programming Language MCQ Declaration and Access Control in Java
⚠ Report ✓ Question Verified Copy Link
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--;
}
}
Learn More MCQ Questions from Java Programming Language MCQ Declaration and Access Control in Java