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...

The purpose of the ________ module is to collect data on security related events on the host and transmit these to the central manager.

A. central manager agent B. LAN monitor agent C. host agent D. architecture agent

Computer Science & Information Technology

Which language was developed by Microsoft in the early 1990s to simplify the development of Windows applications?

a. Visual C#. b. Python. c. Objective-C. d. Visual Basic.

Computer Science & Information Technology