"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)
About Question enthuware.ocpjp.ii.v11.2.1812 :
Moderator: admin
-
- Posts: 4
- Joined: Wed Jun 05, 2019 3:22 pm
- Contact:
-
- Site Admin
- Posts: 10398
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.ii.v11.2.1812 :
The problem statement says that the program is run from the command line, so, there is a Console.
Who is online
Users browsing this forum: Google [Bot] and 6 guests