I'm trying to figure out when throws
might be required in a method signature. I'm a bit confused about this. I've seen cases where throws
is not mentioned, where there is just an if (something goes wrong) { throw new someException()}
without any throws in the signature.
And then a small follow up question, how would you go about passing an exception to a different class or method? Say you don't want to deal with an exception in the class or method you're currently writing, how would you pass it along?
Thanks in advance!!