Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 20th, 2003, 07:27 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Static Constructors

Hi Again!!

I have just found that static constructors can not specify access modifiers... I was wondering why....

somebody please explain...!!

much appreciated.......

Ibn_aziz
Reply With Quote
  #2 (permalink)  
Old December 20th, 2003, 05:21 PM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How are you using it in your code?

Is this an error message you got?

Reply With Quote
  #3 (permalink)  
Old December 21st, 2003, 10:43 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually... I got this from one of the CSharp books........
It states that because static constructors are automatically private...... no other access modifiers may be specified.. including private.....

but I was just wondering why they were automatically private... I can't seem to find the link!!
Reply With Quote
  #4 (permalink)  
Old December 25th, 2003, 04:07 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Specifying an access modifier for a static constructor would be meaningless as it is never called by any kind of C# code that you write to make use of the class, instead they are called by the .Net Environment as the class definition is loaded for the first time in the program.

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constructors madhuriguda C# 2 April 29th, 2008 08:11 AM
Constructors - instantiation brysora C# 2005 1 September 3rd, 2007 08:45 PM
non-static reports to static html files miamikk ASP.NET 2.0 Basics 0 June 4th, 2007 01:48 PM
Cascading Constructors rodmcleay General .NET 4 May 18th, 2007 03:57 AM
COPY CONSTRUCTORS gbilios C++ Programming 4 April 30th, 2004 02:51 AM



All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.