質問するログイン新規登録

回答編集履歴

1

インデントが変になったので直す

2023/10/19 07:57

投稿

fana
fana

スコア12253

answer CHANGED
@@ -4,13 +4,13 @@
4
4
  ```C#
5
5
  public class A
6
6
  {
7
- protected virtual int x{ get{ return 1; } }
7
+ protected virtual int x{ get{ return 1; } }
8
- public void C(){ Console.WriteLine(x); }
8
+ public void C(){ Console.WriteLine(x); }
9
9
  }
10
10
 
11
11
  public class B : A
12
12
  {
13
- protected override int x{ get{ return 2; } }
13
+ protected override int x{ get{ return 2; } }
14
14
  }
15
15
  ```
16
16
 
@@ -21,8 +21,8 @@
21
21
  ```C#
22
22
  public class A
23
23
  {
24
- private static int TheStaticX = 1;
24
+ private static int TheStaticX = 1;
25
- protected virtual int x{ get{ return TheStaticX; } }
25
+ protected virtual int x{ get{ return TheStaticX; } }
26
- public void C(){ Console.WriteLine(x); }
26
+ public void C(){ Console.WriteLine(x); }
27
27
  }
28
28
  ```