編譯時就必須固定的常數,所以只能在宣告中初始化。 public const int X = 5; public const int Y = X + 100;. 輸出得到: 5 105.
確定! 回上一頁