What is k after the following block executes?

{
int k = 2;
nPrint("A message", k);
}
System.out.println(k);

a. 0
b. 1
c. 2
d. k is not defined outside the block. So, the program has a compile error

d k is defined inside the block. Outside the block, k is not defined.

Computer Science & Information Technology

You might also like to view...

Which tab displays the tools for creating charts?

A) Chart B) Data C) View D) Insert

Computer Science & Information Technology

Which of the following password policy settings forces users to use a combination of lowercase and uppercase letters in addition to numbers and special characters in their passwords?

a. Password history b. Password complexity requirements c. Minimum password age d. Maximum password age

Computer Science & Information Technology