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

回答編集履歴

1

訂正

2021/12/01 01:48

投稿

退会済みユーザー
answer CHANGED
@@ -70,8 +70,9 @@
70
70
  // または演算子 + をオーバーロード
71
71
  public class Message
72
72
  {
73
+ // フィールドを public にするのはお勧めしません
73
- public static readonly string Message1 = "ok";
74
+ private static readonly string Message1 = "ok";
74
- public static readonly string Message2 = "ng";
75
+ private static readonly string Message2 = "ng";
75
76
 
76
77
  // インデクサを定義
77
78
  public string this[int index]