I have a question about exceptions.
I don't really understand the underlying purpose of throwing an exception. I know that the programmer can allow for correction of the error without throwing the exception, and they could cause the program to abort without an exception as well, so why exactly throw an exception. Instead of using the try and catch, why not just try and write code that corrects the error or allows the user to correct the error. I know it's necessary and has a useful purpose, but so far I just can't grasp what that is. Any examples of exceptions that are necessary?