Page 1 of 1
About Question enthuware.ocpjp.v8.2.1812 :
Posted: Sat Jun 11, 2016 7:07 pm
by mtrikannad
Isnt it possible for this code to generate NullPointerException if console is not available ?
Regards
Mahesh
Re: About Question enthuware.ocpjp.v8.2.1812 :
Posted: Sat Jun 11, 2016 9:02 pm
by admin
Yes, it is possible. Generally, you can assume that whenever a question asks you to compile and run a program, it is asking you to do so from the command line. So the console will be available.
Even so, the problem statement has now been updated to say, "What will happen when it is compiled and run from the command line?" This should take care of the ambiguity.
thank you for your feedback!
Paul.