Given the following application, what is the expected output?
public class MyClass { private boolean numLock = true; static boolean capLock = false; public static void main(String... shortcuts) { System.out.print(numLock+" "+capLock); } }
C.
The numLock
variable is not accessible in the static main()
method without an instance of the MyClass class.
The code does not compile.
Option C is the correct answer.