Chapter 10.0

Chapter 10.0 - Chapter 10.0 Very Brief Introduction to Java...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 10.0 Very Brief Introduction to Java I/O
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Introductory Points Java I/O is primarily “stream-oriented.” Data flows into the program and out of the program, like a ‘stream.’ We have ‘input’ streams and ‘output’ streams. “Standard” I/O streams: System.in – defaults to the keyboard System.out – defaults to the monitor System.err – defaults to where System.out is: monitor. These are all public and static and found in the System class of the Java API.
Background image of page 2
Standard I/O We’ve used standard I/O in creating Scanner objects to process data normally associated with standard input (keyboard) and standard output (monitor). “I/O exceptions” are handled for us by Scanner. Many ‘opportunity for problems in doing any kind of input output: examples include files not defined; file not found; formats not what were expected, EOF early, etc. and other exceptions. I/O in Java can be very complicated. We oftentimes need to be able to read text data or pure binary data. These can come from external files, memory, or from strings. Here, we will emphasize input/output as it pertains to external files.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
The java I/O package The java.io package provides us classes that let us define desired input and output streams. Because we use the
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

Chapter 10.0 - Chapter 10.0 Very Brief Introduction to Java...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online