Skip to content

Instantly share code, notes, and snippets.

@daleth90
Created Nov 10, 2018
Embed
What would you like to do?
using System;
namespace Playground {
class Program {
static void Main() {
int a = 30;
for ( int i = 0; i < 10; i++ ) {
int a = 9; // 編譯錯誤,無法在此範圍宣告名為 a 的區域變數與參數,因為 a 這個名稱已經在這裡以上的區塊被使用了
Console.Write( a + i );
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment