Console STATIC CLASS

Console provides means to input from and output to the standard character-oriented terminal of the operating system, which are collectively called standard input/ouput. If the standard IO has been redirected externally to the script engine, this class will be affected as well, so technically it's not tied to the console per se.

Parent Class

All Members


TypeNameSignature
method Serrorpublic static void error(var)
method Serrorlnpublic static void errorln(var)
method Sprintpublic static void print(var)
method Sprintlnpublic static void println(var)
method Sreadlnpublic static String readln()

Methods


public static void error(var value)

Print the given value to the standard error, which is by default output to the console as well. If the value is an Object, calls Object.toString() to get the string to output. If the value is of primitive type, prints its literal representation. If the value is null, prints "(null)" (quotes excluded).

Parameters

  • value a value to print out to the standard error.

public static void errorln(var value)

Print the given value, converted to String, to the standard error, then a line break sequence as defined by the underlying operating system. The standard error is by default output to the console as well. See toString() for more details.

Parameters

  • value a value to print out to the standard error, preceding a new line.

public static void print(var value)

Print the given value to the console. If the value is an Object, calls Object.toString() to get the string to output. If the value is of primitive type, prints its literal representation. If the value is null, prints "(null)" (quotes excluded).

Parameters

  • value a value to print out.

public static void println(var value)

Print the given value, converted to String, to the console, then a line break sequence as defined by the underlying operating system. See toString() for more details.

Parameters

  • value a value to print out, preceding a new line.

public static String readln()

Read the characters from standard input, until a line break sequence as defined by the underlying operating system is met. This method will be blocking the thread until the line break is consumed.

Required Policies

  • System.Console/read

Returns

  • The string comprised of the input characters, excluding the line break at the end.