Analyze the following code.

```
public class Test {
public static void main(String[] args) {
int n = 2;
xMethod(n);

System.out.println("n is " + n);
}

void xMethod(int n) {
n++;
}
}
```
a. The code has a compile error because xMethod does not return a value.
b. The code has a compile error because xMethod is not declared static.
c. The code prints n is 1.
d. The code prints n is 2.
e. The code prints n is 3.

b. The code has a compile error because xMethod is not declared static.

Computer Science & Information Technology

You might also like to view...

What are two common uses for the Date function?

What will be an ideal response?

Computer Science & Information Technology

What is information hiding?

What will be an ideal response?

Computer Science & Information Technology