What will be displayed after the following statements are executed?

```
int y = 10;
if (y == 10)
{
int x = 30;
x += y;
System.out.println(x);
}
```

a. 40
b. 30
c. 20
d. The code contains an error and will not compile.

a. 40

Computer Science & Information Technology

You might also like to view...

When creating tables, it is possible to split one cell into:

A) as many cells as you like. B) 2 cells only. C) up to 63 cells. D) 4 cells only.

Computer Science & Information Technology

Which statement is false?

a. A generic method may be overloaded. b. A class can provide two or more generic methods that specify the same method name but different method parameters. c. A generic method cannot be overloaded by non-generic methods. d. When the compiler encounters a method call, it searches for the method declaration that most precisely matches the method name and the argument types specified in the call.

Computer Science & Information Technology