![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello I know this is extremely basic, I just want to make sure I got it right. is: try{} catch{} the same as try{} catch(System.Exception e){} I mean if I am not using the reference to the exception then I should simply use catch{} ? or is catch(System.Exception){} somehow more restricted on what it catches than simply catch{}? Thanks in advance JT. System.Exception is the base class for all exception types, therefore not |
#3
| |||
| |||
|
|
Hello I know this is extremely basic, I just want to make sure I got it right. is: try{} catch{} the same as try{} catch(System.Exception e){} I mean if I am not using the reference to the exception then I should simply use catch{} ? or is catch(System.Exception){} somehow more restricted on what it catches than simply catch{}? Thanks in advance JT. |
#4
| |||
| |||
|
|
John, In addition to the other comments. For C# & VB.NET code both are the same, as both languages only support throwing exceptions that inherit from System.Exception. However! If you call another language that allows you to throw exceptions that do not derive from System.Exception will cause the two statements to be semantically different. For details see: http://msdn.microsoft.com/library/de...pspec_8_10.asp Hope this helps Jay "John" <John (AT) discussions (DOT) microsoft.com> wrote in message news:BF5F960E-3B48-48DC-ABC8-EC9227B185DC (AT) microsoft (DOT) com... | Hello I know this is extremely basic, I just want to make sure I got it right. | | is: | | try{} | catch{} | | the same as | | try{} | catch(System.Exception e){} | | I mean if I am not using the reference to the exception then I should simply | use | catch{} ? or is catch(System.Exception){} somehow more restricted on what | it catches than simply catch{}? | | Thanks in advance | | JT. | |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
Actually I am glad I posted this on "microsoft.public.dotnet.academic" and on: "microsoft.public.dotnet.general" as I now discovered I got the wrong answer on "microsoft.public.dotnet.general" check it out: http://msdn.microsoft.com/newsgroups...=en-us&m=1&p=1 |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |