The Console class is used to create the instance of a console. A console is a character-based unique device that associates with a JVM. The console of a JVM is dependent upon the following two factors:
- The underlying platform
- The manner in which the virtual machine is invoked.
If JVM uses an interactive command line without redirecting the standard input and output streams, then its console will exist and will typically be connected to the keyboard and display from which the virtual machine was launched. If JVM starts automatically, it will typically not have a console. It may be possible that the JVM does not have any console. If JVM has a console, then it is represented by a unique instance of the Console class, which can be obtained by invoking the System.console() method.
Responses to “What is the console class?”