看板 Programming 關於我們 聯絡資訊
: 建構子只能在物件被建立的時候呼叫 : class A { : public A() { : initVariables(); : ... : } : public A(int i) { : initVariables(); : ... : } : public void initVariables() { : ... : } : } 沒啥用的範例 class TestFor { public TestFor() : this(10) { } public TestFor(int i) :this(i,i) { } public TestFor(int a, int b) { } } 別用java的語法套到c#上... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.229.47.226