GeeCON Prague 2014*
The moose likes Java in General and the fly likes What is a Console class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "What is a Console class" Watch "What is a Console class" New topic
Author

What is a Console class

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

whats a console class?is it like suporting command prompt


http://www.lifesbizzare.blogspot.com || OCJP:81%
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3833

I think you are talking about the Console class?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

yes
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3833

Quoting from the API:
Methods to access the character-based console device, if any, associated with the current Java virtual machine....
If the virtual machine is started from 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 the virtual machine is started automatically, for example by a background job scheduler, then it will typically not have a console.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39053
    
  23
. . . which means inter alia, if you start a JVM with javaw and try to get a java.io.Console and use it, you suffer a NullPointerException.
 
GeeCON Prague 2014
 
subject: What is a Console class