Kotlinlearncs.online LogoJava
Return to List

Homework: Catching Exceptions

Created By: Geoffrey Challen
/ Version: 2020.11.0

Create a public class called Catcher that defines a single class method named catcher. catcher takes, as a single parameter, a Faulter that has a fault method. You should call that fault method. If it generates no exception, you should return 0. If it generates a null pointer exception, you should return 1. If it throws an illegal argument exception, you should return 2. If it creates an illegal state exception, you should return 3. If it generates an array index out of bounds exception, you should return 4.

Related Lessons

Stuck? You may find these lessons helpful: