How can I throw an exception for the whole class instead of doing it method by method

Dream Lane picture Dream Lane · Dec 10, 2010 · Viewed 12.4k times · Source

I'm writing a program in Java, and nearly every method in one of my classes is written like:

public void doStuff() throws AWTException{}

Is there a way for me to get rid of the extra step of typing throws AWTException for each method, and somehow do it for the entire class?

Answer

Asaph picture Asaph · Dec 10, 2010

Sorry, No. There is no way to do this in Java.