What are static variables?
Variables that have only one copy per class are known as static variables. They are not attached to a particular instance of a class but rather belong to a class as a whole. They are declared by using the static keyword as a modifier.
static type varIdentifier;
where, the name of the variable is varIdentifier and its data type is specified by type.
Note: Static variables that are not explicitly initialized in the code are automatically initialized with a default value. The default value depends on the data type of the variables.
| Print article | This entry was posted by on December 11, 2009 at 10:55 am, and is filed under .Net, Dot Net. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
