SCJP Certification

Sun Certified Java Programmer Certification exam essentials

February 12th, 2010

What is the console class?

Java Facts, by Daisy Williams.

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:

  1. The underlying platform
  2. 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.

Share

Back Top

Responses to “What is the console class?”

Comments (0) Trackbacks (0) Leave a comment Trackback url
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*