Exception invasion

  • 8
  • Locked
In reality, there are oceans of exceptions in programs, and you'll eventually get used to them. You can start right now: populate the list exceptions with ten (10) different exceptions. The first exception is already implemented in the initExceptions method.
You can't complete this task, because you're not signed in.
Comments (6)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Alaskian7134
Level 22 , Iasi, Romania
2 June 2021, 13:45
you can just make
list.add(new Ex
and see what sugestions the IDE will give you and finish everything in 20 seconds, you don't really need to do the try-catch block for every exception. but to be honest i find it really fun to do the try-catch for evert exception and i think is a good practice. took me about 20 minute to remember 10 exceptions and a way to throw each of it
Karas Java Developer
31 March 2021, 19:09
or just throw an specific new exception hahahaha.
Libby
Level 20 , United Kingdom
4 March 2021, 17:35
you don't have to make a try/catch block to get your exception as they give us for the first exception. you just have to add 'new exception' to the ArrayList
list.add(new Exception());
Ed Maphis
Level 20 , Painesville, United States
4 June 2019, 16:12
This one took some research.
Andrew
Level 29 , Seattle, United States
30 January 2019, 22:07
This is an awesome exercise. Very valuable experience.
Benjamin Winchester
Level 17 , Savannah, United States
2 December 2018, 08:05
HAHAHA, make 10 user-defined exceptions...