I have a java method which is potent of throwing multiple unchecked exceptions. My question is: do I need to declare it to throw all the the exceptions or Is there any problem if I declare throws Exception
only?
Method 1:
public void myMethod() throws Exception1,Exception2,Exception3,Exception4,Exception5
{}
Instead of method 1, can I declare like this?
public void myMethod() throws Exception
{}