Example Java project created via STS as Java Project, showing how to;
- create Checked Exceptions (MyException1, MyException2, MyException1Child),
- create Checked Exceptions that are child of other Checked Exception (MyException1Child),
- throw ing checked Exceptions (Main.method1),
- handle checked Exceptions thrown by called methods via either try/catch or throws (MyMain.useMethod1,2,3,4,5),
- how checked Exception inheritance can be used in overwriting methods in Child classes that throws these Exceptions,
- how to wrap an Exception into another Exception (via its constructor that takes a Throwable) and throw that
Make sure on your machine, you have;
- git installed
- a working unix shell (like git bash. If not there install git and use its "git bash")
- working JDK installed (with JAVA_HOME env variable added, and PATH env variable prefixed with %JAVA_HOME%/bin)
As example, at bash command line issue;
mkdir -p /c/it114/exampleProjects
cd to where you put your example projects.
As example, at bash command line issue;
cd /c/it114/exampleProjects )
git clone https://github.com/njit-it114/example-java-exception.git
or
git clone https://github.com/njit-it114/example-java-exception.git whateverDirectoryNameYouWantStuffToBeClonedInto
- README.md this read me file
- src directory of java packages
- design directory of design documents, like class diagram