The exercises in this project are designed to help you understand error handling in Java.
To get started, open the project file located in
error-handling-in-java/pom.xml
in IntelliJ.
This project contains a Main
class that contains several methods that
demonstrate various aspects of error handling in Java. There is one other
supporting classes in the project:
- The
CustomDivideByZeroException
class is a custom exception that is thrown when a division by zero is attempted. You WILL need to modify this class.
The ExerciseTests
class contains tests for the Main
class.
To complete this exercise, you will need to follow the TODO
comments in the
Main
class and the CustomDivideByZeroException
class.
As always, final verification of your code should be done by running the unit tests.
To run the tests, right-click on the test/java/org.example/src/ExerciseTests
class and select "Run 'ExercisesTests'". This will run all of the tests for
the exercises. When a test succeeds, you will see a green checkmark next to
the test. When a test fails, you will see a red X next to the test. Once all
of the tests pass, you have completed the exercises.