-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStaticConstrucor
More file actions
66 lines (55 loc) · 1.04 KB
/
Copy pathStaticConstrucor
File metadata and controls
66 lines (55 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
class A
{
protected static int a, b;
protected int c;
static A()
{
a = 10;
Console.WriteLine("static A");
}
public A()
{
a = 5;
Console.WriteLine("A Constructor");
c = 0;
}
}
class B:A
{
static B()
{
b = 20;
a = 30;
Console.WriteLine("Staic B");
b = 20;
a = 30;
}
public B(int a)
{
Console.WriteLine("B Constructor");
c = 4;
a = 7;
}
}
class C:B
{
static C()
{
a = 10;
Console.WriteLine("Static C");
}
public C():base(10)
{
Console.WriteLine("C Constructor");
c = 0;
a = 70;
}
}
class Program
{
static void Main(string[] args)
{
C c = new C();
Console.ReadKey();
}
}