man command
.
System.in
object for the standard input
to a program, corresponding to the System.out
object
for standard output.
System.in
is a member of java.lang.InputStream
.
InputStream
s.
DataInputStream
from
the input stream.
DataInputStream
from
the file, rather than standard input.
DataInputStream
provides much more useful and
usable methods than InputStream
. However, these
methods are generally only appropriate for non-character data
and assume that you've written the data using a
DataOutputStream
.
DataInputString.readByte()
,
but that will require you to do a lot of work converting to
appropriate forms.
EOFException
is thrown when you try to read
beyond the end of the file.
DataInputStream
and its associated exceptions are not
automatically part of your program. You must import them. It is
easiest to do so with import java.io.*
.
Reader
(and, more importantly,
InputStreamReader
and BufferedReader
).
new BufferedReader(new InputStreamReader(System.in));
readLine()
method does not seem to throw
EOFException
s.
package packagename
directive at the
start of your code. It must be the first statement in your
.java
file.
foo.bar.baz
, the
package would be in the foo/bar/baz
relative to some
place on your CLASSPATH
).
com.company.division.package
.
edu.grinnell.yourname.coursename.package
.
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
Source text last modified Mon Nov 10 08:57:05 1997.
This page generated on Mon Nov 10 10:13:09 1997 by SiteWeaver.
Contact our webmaster at rebelsky@math.grin.edu