Which is a better approach to exception handling and why?:
(1) Defining a single exception for the whole application which takes a string message and displays it. Use this exception everywhere with a specific message appropriate to the scenario.
I have no idea why this is not appropriate.
(2) Defining a new exception class for each different case in the application.
I feel this is not appropriate because there are cases where the exception is at just one place in the application. e.g. amount entered is -ve Is it ok to create a whole new exception class just for a single case in the app ?
Define a new exception for each kind of error that matters to your user. So, for example, ideally you should catch NullPointerException inside your program, and turn it into a CustomerLookupException to that the user level of the program can report “Software error retrieving customer.” Exception chaining is handy for this, as you can pass along the original exception as well.
The whole Java Tutorial on exceptions is a good resource.