Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / December 2003

Tip: Looking for answers? Try searching our database.

throws

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Abc - 22 Dec 2003 08:25 GMT
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
GIJO VARGHESE - 22 Dec 2003 10:43 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.