Javatpoint Logo
Javatpoint Logo

Java System console() Method

The console() method of Java System class returns Console object only if any Console objected is associated with the java virtual machine.

Syntax

Returns

  1. The Console object of current java virtual machine.
  2. Null if Console object is not associated with current java virtual machine.

Example 1

Test it Now

Output:

Console is not supported

Example 2

Test it Now

Output:

Console is null

Next TopicJava System



Help Others, Please Share

facebook twitter pinterest