Beginning Java Programming: The Object-Oriented Approach Chapter 6 runtime exception

This is the live code sandbox for Beginning Java Programming: The Object-Oriented Approach Chapter 6. This example demonstrates a “Divide by Zero” runtime exception.
The exception is thrown on line 11 because the value of yearsInRetirement is set to zero. Click “Run” to run the example in your browser then edit the code to fix it and click “Run” to run it with your changes.
You can download the complete code for Beginning Java Programming: The Object-Oriented Approach as well to work with it in your own code editor.

Return to the complete list of live code sandbox examples for Beginning Java Programming: The Object-Oriented Approach

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *