Handling Java Exception - TechRepublic
General discussion
April 11, 2006 at 11:07 AM
kat97

Handling Java Exception

by kat97 . Updated 20 years, 2 months ago

Hi,

Needed some help in java programming. Thanks

What is the meaning of ‘throws NumberFormatExecption’ here?
public static void inputInteger() throws NumberFormatException{ … }

If i write the following statement, when i compile the program will have error saying exception not thrown or declared. Why the above statement doesn’t have the same error?
public static void inputInteger() throws Exception{ … }

This discussion is locked

All Comments