Let me get this straight.
If I have code that may throw an exception, I enclose this code in a throw block right?
Then, to deal with the exception I have to proceed with catch blocks.
Suppose I identified the type of exception that may occur and I create an exception block for it. I've successfully handled the exception then.
Why is the THROWS needed?
When creating a method, it is said that you need to specify the type of exception that will occur if the exception is checked. How does Java determine if an exception is going to occur during compile time, and if such an exception checked and not unchecked, or does it not determine that and simply halt the program when an checked exception that is not accounted for occurs?
I'm guessing if I don't specify that, say the method Circle(double radius) may throw a IllegalArgumentException and a negative raidus was entered the program would terminate right and not be able to proceed or be dealt with? In this case I specify the specific exception because that exception is checked?
If I specify that the exception is checked, why is it said that Java needs to propogate throw a check stack to see which exception occurred matches the exception in the callstack when I already told it in this instance?
I will GILD whoever helps me out and explains everything in details. I really mean it, thanks.