Console Input and Output in Java
An Introduction |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
main()
is calledSystem.in
System.out
System.err
System.out
,
System.err
, and/or System.in
?PrintStream
Object (cont.)String
literalsboolean
char
String
PrintStream
Object (cont.)
printf()
Scanner
Object (cont.)
Scanner
Scanner
(cont.)
Scanner
ObjectsScanner
Object (cont.)nextLine()
immediately after
invoking one of these methodsConsole
object can be retrieved using
the System.console()
method and
it has both readLine()
and printf()
methodsconsole()
method returns null
in IDEs