checked 關鍵字

CSharp · Console

/Program.cs

using System;
					
public class Program
{
	public static void Main()
	{
		//unchecked
		checked
		{
			int n = int.MaxValue;
			n = n + 1;
			Console.WriteLine("Hello World:"+n);
		}
		
	}
}
;