Console.WriteLine이 왜 빈 줄을 작성하고 ( Console.WriteLine(null)컴파일 오류가 발생 a+=1합니까) NullReferenceException이없는 이유 (심지어 발생 해서는 안 됨 )를 설명해 주 시겠습니까?
int? a = null;
a++; // Why there is not NullReferenceException?
Console.WriteLine(a); // Empty line
NullReferenceException? 하지만 int?하지 않은 것입니다 Reference그것은 단지입니다, int취할 수있는 null값을
++,+=및+변형을 해제했다. 따라서 문은a++;,a += 1;그리고a = a + 1;모두 사용할 수 있습니다. 초기에 각 생산물null(예외 발생 없음) .anull