I am a beginner in Java.
I declared a method as public void method() throws Exception
, but whenever I try to call that method in another area of the same class by using method();
, I get an error:
Error: unreported exception java.lang.Exception; must be caught or declared to be thrown
How can I use that method without getting this error?