C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
5
Reply
What is a static constructor in C#?
Kunal Gautam
12y
1.5k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
1) A class can have one and only one Static Constructor. 2) The Static Constructor should not have any access modifier. 3) Static Constructors should not have any parameters. 4) The Static constructor will be executed only one time irrespective of number of objects created 5) Runtime invokes the Static Constructor when it creates an instance of the class or before the first static member being accessed. 6) The Static Constructor executes before any of the instance level constructors.
Pramod Verma
10y
0
constructor are only default ,parameterised and copy i didn't ever listen static constructor ... but static word can use with constructors ... like public sara() { Console.writeLine(" its non static and have an extra place in heap"); } static public sara() { console.writeLine("its static,and the value place on the same place no extra space here use it "); }
Sara MeCaal
11y
0
constructor are only default ,parameterised and copy i didn't ever listen static constructor ... but static word can use with constructors ... like public sara() { Console.writeLine(" its non static and have an extra place in heap"); } static public sara() { console.writeLine("its static,and the value place on the same place no extra space here use it "); }
Sara MeCaal
11y
0
A constructor that is declared using static modifier is a static constructor. Static constructor executes one and only one time in the life cycle of class. It is the first block of code to execute in class. A static constructor can not be parametrized.
Ranjit Powar
11y
0
A constructor that is declared using static modifier is a static constructor. Static constructor executes one and only one time in the life cycle of class. It is the first block of code to execute in class. A static constructor can not be parametrized.
Ranjit Powar
11y
0
What is Inheritance in C#?
What is a sealed class in C#?
Message