About Question enthuware.ocpjp.ii.v11.2.1812 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
kevvvvyp
Posts: 4
Joined: Wed Jun 05, 2019 3:22 pm
Contact:

About Question enthuware.ocpjp.ii.v11.2.1812 :

Post by kevvvvyp »

"java.lang.System
public static Console console()
Returns the unique Console object associated with the current Java virtual machine, if any."

The answer to this question is implementation specific for example when run on my machine accessing c.readPassword will throw a NPE.

Proposed rewording: What will happen when this code is compiled and run from the command line (assume that there is a unique Console object associated with the Java virtual machine)

admin
Site Admin
Posts: 10398
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.1812 :

Post by admin »

The problem statement says that the program is run from the command line, so, there is a Console.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests