Difference-between-static-and-non-static-variable-in-Csharp

Difference between static and non-static variable in C#

Difference between static and non-static variable in C#

 

Staic Variable Non Static Variable
Staic keyword must be used to declare Doesn’t use static keyword to declare variable. Also called as Object variable.
Called by classname.variable Called with Ojbect.variable
Only one copy would be generated. Multiple copies could be generated along with creation of object.
Initialization done before object creation. Initialization done after object creation.

 

Folks you should also refer below articles for better understanding of differences between:

Leave a Reply