舉例如下
class Demo1 {
public int x;
public int y;
}
class Demo2 {
static void Main() {
Demo1 d = new Demo1();
d.x = 10;
d.y = 22;
System.Console.WriteLine(d.x);
System.Console.WriteLine(d.y);
}
}
/* 《程式語言教學誌》的範例程式
http://pydoing.blogspot.com/
檔名:new.cs
功能:示範 C# 程式
作者:張凱慶
時間:西元 2013 年 6 月 */編譯執行,結果如下

| 中英文術語對照 | |
|---|---|
| 關鍵字 | keyword |
| 物件 | object |
您可以繼續參考
運算式
型態轉換
相關目錄
回 C# 快速導覽
回 C# 教材
回首頁
參考資料
Standard ECMA-334 C# Language Specification
msdn: C# 運算子
沒有留言:
張貼留言