static Members
static members belong to the type, not to objects.
Example
new Counter(); new Counter();
Console.WriteLine(Counter.Count);
class Counter
{
public static int Count;
public Counter() { Count++; }
}Exercise
Type level member.
public int n;
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.