TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Upamanyu Roy Choudhury
NA
343
5.4k
Why a static contructor in C# are not overloaded?
Feb 11 2013 6:57 PM
Dear All,
We all know static condtructors in C# are used to initialize the static data members within a class.
But it cannot be overloaded.
My question is that why this feature is not supported?
My understanding::
Is it just because that we cannot associate an object with the static constructor like the way we do it in case of non static ones by explicitly calling them while crating an instance of the class. See the following
ClassEmployee objClassEmployee = new objClassEmployee("Emp001","Upamanyu",30000); // explicitly calling the overloaded contrcutor
But we cannot do like that
StaticCons();
StaticCons(("Emp001","Upamanyu",30000); // we do not call static construtors, it gets called before the first instance of the class gets referenced.
So the overloaded feature is off in case of static ones???
Please provide your views on it.
Many Thanks,
Upamanyu
Reply
Answers (
6
)
C# Windows form to Word 2010
how to change c# form app to c# console app?