Skip to main content

What is the difference between static constructor and instance constructor?

Mid C#
Quick Answer An instance constructor runs every time you create an object with new รขโ‚ฌโ€ initializes that specific instance. A static constructor runs once รขโ‚ฌโ€ the first time the class is accessed รขโ‚ฌโ€ to set up static members shared across all instances. Neither can be called manually; both run automatically.

Answer

Static constructor: Initializes static members once per type.

Instance constructor: Initializes object instances and runs per object.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice