Let's assume I'm a complete lazy bum and I don't want to invest the several dozen keystrokes needed for my own exception class (it's not utterly important which gets used, really). However, to pretend I'm following good practices here, I want a pre-existing one that best fits my situation.
Problem: I need to throw an exception when my class's constructor receives an object in its parameters that is not found within a given list I've built elsewhere.
Which exception class would be appropriate to throw for that?
IllegalArgumentException
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With