Creating Custom Java Exceptions

# Introduction In Java, exceptions are thrown to indicate exceptional events that occur during the execution of a program. While Java provides a range of in-built exceptions, sometimes we may need to define our own custom exception for specific situations. There are two types of custom exceptions: checked and unchecked exceptions. Checked exceptions are those that need to be handled during compile time, whereas unchecked exceptions are only detected during runtime. In this lab, we will create both types of custom exceptions and learn how to use them.

|60 : 00

Click the virtual machine below to start practicing