What is the output for the second statement in the main method?

```
public class Foo {
static int i = 0;
static int j = 0;

public static void main(String[] args) {
int i = 2;
int k = 3;
{
int j = 3;
System.out.println("i + j is " + i + j);
}

k = i + j;
System.out.println("k is " + k);
System.out.println("j is " + j);
}
}```
a. k is 0
b. k is 1
c. k is 2
d. k is 3


c When computing k = i + j, i is 2 and j is 0

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1) Menus are used to offer several organized choices for the user. 2) Custom controls can be created but cannot be inserted into the toolbox. 3) Menus group similar commands and prevent GUI clutter. 4) To set an underline shortcut in a Menu, you use the tilde key (~).

Computer Science & Information Technology

TextBoxes, Buttons and RadioButtons are examples of .

a) platforms b) high-level languages c) IDEs d) controls

Computer Science & Information Technology

A(n) ________ is a collection of related tables forming a database.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Windows is equipped with three types of event logs: system event log, security event log, and ________ event log.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology