How to use throws clause in static functions in j#.
I got following error when trying to use that in a
static function.
'System.ApplicationException' cannot be thrown by static
initializer or static field initializer
Thanks
Hi,
This behavior is as per the language specs.
'System.ApplicationException' is a checked exception.
Static initializer or static field must not result in checked exception.
If one does, a compile time error occurs.
The workaround can by using explicit try catch blocks inside the static
function.
-Gijo Varghese
Visual J# Product Team.
--------------------
>Content-Class: urn:content-classes:message
>From: "Abc" <anonymous@discussions.microsoft.com>
[quoted text clipped - 23 lines]
>
>Thanks
---------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
GIJO VARGHESE - 29 Dec 2003 04:25 GMT
Hi,
I am closing this thread as per my previous posting.
Hope this clarifed your scenario.
Please get back to us if you need further clarifications on this.
Gijo Varghese
Visual J# Product Team.
---------------------------------------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.