Page 1 of 1

About Question enthuware.ocpjp.v8.2.1286 :

Posted: Sun Oct 16, 2016 1:24 am
by TomorrowWorld
This question nor answer doesn't make any sense to me at all. Can anyone describes what that question is asking and the explanation given to that answer?

All I know is that, some operating systems may not support

Code: Select all

Console 
class to be instantiated. In that case,

Code: Select all

System.console()
will return

Code: Select all

null
.

Re: About Question enthuware.ocpjp.v8.2.1286 :

Posted: Sun Oct 16, 2016 6:19 am
by admin
That is correct. You use System.console() to acquire Console object but it will return null if the JVM instance doesn't support Console. That is all that it is asking.

Re: About Question enthuware.ocpjp.v8.2.1286 :

Posted: Tue Dec 18, 2018 11:37 am
by lennychapfuwa
"If no console device is available then an invocation of that method will return null." What is a console device. Can you really explain what is a console. Is it a class, or some software that facilitates some operation.

Re: About Question enthuware.ocpjp.v8.2.1286 :

Posted: Tue Dec 18, 2018 11:56 am
by admin
Are you following any book? If not, please go through this to learn all about Console: https://docs.oracle.com/javase/7/docs/a ... nsole.html

Usually, Console is nothing but the command window from where you run your java class.