Specifications
Sun Services
Java™ Programming Language
x
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
The try-catch Statement ..................................................................................................................... 8-7
Call Stack Mechanism .......................................................................................................................... 8-10
The finally Clause ............................................................................................................................. 8-11
Exception Categories ............................................................................................................................ 8-12
Common Exceptions ............................................................................................................................. 8-13
The Handle or Declare Rule ................................................................................................................ 8-14
Method Overriding and Exceptions ................................................................................................... 8-15
Creating Your Own Exceptions .......................................................................................................... 8-17
Handling a User-Defined Exception .................................................................................................. 8-18
Assertions ............................................................................................................................................... 8-20
Recommended Uses of Assertions ..................................................................................................... 8-21
Internal Invariants ................................................................................................................................. 8-22
Control Flow Invariants ....................................................................................................................... 8-23
Postconditions and Class Invariants .................................................................................................. 8-24
Controlling Runtime Evaluation of Assertions ................................................................................ 8-25
Text-Based Applications ......................................................................................... 9-1
Objectives ................................................................................................................................................. 9-2
Relevance .................................................................................................................................................. 9-3
Command-Line Arguments .................................................................................................................. 9-4
System Properties .................................................................................................................................... 9-6
The Properties Class ........................................................................................................................... 9-7
Console I/O ........................................................................................................................................... 9-10
Writing to Standard Output ................................................................................................................ 9-11
Reading From Standard Input ............................................................................................................ 9-12
Simple Formatted Output .................................................................................................................... 9-14
Simple Formatted Input ....................................................................................................................... 9-15
Files and File I/O .................................................................................................................................. 9-16
Creating a New File Object ............................................................................................................... 9-17
The File Tests and Utilities ................................................................................................................ 9-18










