A project on Java exceptions
Before you begin this project, you need to be familiar with exceptions in Java.
If you are not familiar with it already, watch this tutorial.
It is highly recommended to type and run the code along with the video on any IDE or using an online compiler such as online-java.com.
Write a program with a custom exception. Then throw the exception when a certain condition is not met. More details are provided in the project file and in the output section below. This project will let you experiment with exceptions.
-
-
If you're using an online compiler: Copy the code from the project file Exceptions.java and paste it in an online java compiler. Change the class name and its references to "Main" to match the file name of the online compiler (or you can create a new file in the online compiler and name it the same as the file name given here). Watch this tutorial for full comprehension.
-
If you're using a code editor IDE: Download the code (ZIP file). Watch this to learn how to do that.
-
If you have git installed: Clone the repository.
-
-
- There are two blocks of code you need to add and one line of code to edit. Each block comes with a number (example: // 1️⃣ FIRST) that indicates the order in which you must do the project. Complete the first block before moving on to the second and third. The instructions for the code you need to write are given with 🔴 emoji and the areas are marked with ⬇️⬆️ emojis. Do NOT write anything outside these areas.
- Once you are done, run the code in your editor and make sure that your method is correct and your the format of your output matches the one given below.
-
Your program should tell the user if their email address is valid or not.
-
- If you're using an online compiler: Simply create a new file, add your filename including your name (eg: SalmaExceptions.java) and open a pull request. Watch this to learn how to do that.
- If you're using a code editor IDE: Before submitting, change the name of the file to include your name. Watch this to learn how to do that.
For example:
If your name is Salma, change the name of the file to SalmaExceptions.java - Similarly, change the name of your class (and all its references) to include your name (otherwise, the code will not run in your IDE).
- Then create a fork of this repository, submit your file and open a pull request. Watch this to learn how to do that.
Congratulations on completing the project!



