Preview
Third Preview of Implicitly Declared Classes and Instance Main Methods (JEP 477).
Programs can only use IO
when preview features are enabled.
Preview features may be removed in a future release,
or upgraded to permanent features of the Java platform.
Each of this class' methods throws IOError
if the system console
is null
; otherwise, the effect is as if a similarly-named method
had been called on that console.
Input and output from methods in this class use the character set of
the system console as specified by Console#charset
.
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
private static Console | |
public static void | |
public static void | |
public static String | Returns: a string containing the line read from the system console, not including any line-termination characters. Returnsnull if an
end of stream has been reached without having read any characters.the prompt string, may be prompt)null Writes a prompt as if by calling |
IO | back to summary |
---|---|
private IO() |
con | back to summary |
---|---|
private static Console con() |
back to summary | |
---|---|
public static void print(Object obj) Writes a string representation of the specified object to the system console and then flushes that console. The effect is as if |
println | back to summary |
---|---|
public static void println(Object obj) Writes a string representation of the specified object to the system console, terminates the line and then flushes that console. The effect is as if |
readln | back to summary |
---|---|
public static String readln(String prompt) Writes a prompt as if by calling The effect is as if
|