Java Reference
In-Depth Information
Exception
Handling
9
9.1 EXCEPTION HANDLING BASICS 525
try-catch Mechanism 525
Exception Handling with the Scanner Class 527
Throwing Exceptions 530
Example: A Toy Example of Exception Handling 532
Exception Classes 537
Exception Classes from Standard Packages 538
Defining Exception Classes 540
Multiple catch Blocks 551
Exceptions to the Catch or Declare Rule 561
throws Clause in Derived Classes 562
When to Use Exceptions 563
Event-Driven Programming
564
9.3 MORE PROGRAMMING TECHNIQUES
FOR EXCEPTION HANDLING 566
The finally Block
566
Rethrowing an Exception
568
The AssertionError Class
568
ArrayIndexOutOfBoundsException 569
9.2 THROWING EXCEPTIONS
IN METHODS 556
Throwing an Exception in a Method 556
Declaring Exceptions in a throws Clause 558
Chapter Summary 569
Answers to Self-Test Exercises 570
Programming Projects 574
 
 
Search WWH ::




Custom Search