Yes, it's ok. But you should understand the effect. You hand-over the exceptions to others and it would be like a snow ball. From the design point-of-view, it's ok if you throw the exception in try-catch block to your own exception class, not to general Exception.
Yes, you can do that. But when you rethrow a checked exception you either have to declare in the method signature that the methods will throw this Exception. Or you have to catch it back again, looks really ugly:
Compiles and prints out start main ready java.lang.ArrayIndexOutOfBoundsException: 0 at Main.main(Main.java:5)
Yours, Bu.
all events occur in real time
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, the permaculture playing cards