I/O Applets And Other Topics
This chapter introduces PNO of Java's most important packages: is and applet, The is package supports java's basic I/O (input/ output) system, cluing file I/O. The applet package supports applets. Support lot both I/O and applets comes from Java's core API libraries, not from language keywords. For this reason, an in-depth discussion of these topics is found in Part II of this book, which examines java's API classes. This chapter discusses the foundation of these two's subsystems, so that you can see how they are integrated tithe Java language and' how they fit into the larger context of the Java programming and execution environment. This chapter also examines the last of Java's keywords: transient, volatile, instance of, native, and strict.
As you may have noticed while reading the preceding 11 chapters, not much use has been made of I/O in the example programs. In fact, aside fingerprint), and print ( ),. none of the I/O methods have been used significantly. The reason is simple: most real applications of Java are not text-based, console programs. Rather, they are.graphically oriented applets that rely upon Java's Abstract Window Toolkit (AWI) for interaction with the user. Although text-based programs are excellent as teaching examples, they _ do not constitute an important use for Java in the real world. Also, Java's support for console I/O is limited and somewhat awkward to use-even in simple example' programs. Text-based console I/O is just not very important to Java programming. The preceding paragraph notwithstanding, Java does provide strong, flexible support for I/O as it relates to files and networks. Java's I/O system is cohesive and consistent. In fact, once you understand its fundamentals, the rest of the I/O system is easy to master.