-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path14_2.cs
32 lines (29 loc) · 932 Bytes
/
14_2.cs
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
using System;
public class Color {
public static readonly Color Black = new Color(0, 0, 0);
public static readonly Color White = new Color(255, 255, 255);
public static readonly Color Red = new Color(255, 0, 0);
public static readonly Color Green = new Color(0, 255, 0);
public static readonly Color Blue = new Color(0, 0, 255);
// private byte r, g, b;
public byte r, g, b;
public Color(byte r, byte g, byte b) {
this.r = r;
this.g = g;
this.b = b;
}
public static int one() { return 1; }
}
public class Color2 : Color {
public Color2(byte x, byte y, byte z): base(x, y, z) {
}
}
class MainRunner {
static void Main() {
Console.WriteLine(Color.Black.r + " " + Color.Black.g + " " + Color.Black.b);
Color2.Black.r = 22;
Console.WriteLine(Color.Black.r);
Console.WriteLine(Color.one());
Console.WriteLine(Color2.one());
}
}