|
try-catch-finnaly blocks are the main exception handling mechanisms in java and c# and VB.net.
In java you have to use them if the method you are calling has thows keyword in the method header. Its one of the most anoying features if you ask me as you end up with lots of try-catch blocks everywhere especially if you do IO. I know that there are arguements for compulsory try-catch blocks, but IMO it should be up the the programmer to decide if they are necessary. C# never forces you to have a try-catch block, so i guess the same is for VB.net.
IIRC C does not have try-catch blocks in the language spcification. I think there are some extensions that use macros that enable simiar functionality. C++ has try-catch blocks as part of the spec, though im sure die hard C programmers still use older styles of error handling.
|