→ kogrs:line 2 的void 去掉 07/22 00:49
→ kogrs:你的寫法 line 2 會變成是一個 method,去掉void會變成建構子 07/22 00:51
→ Killercat:我不懂 為什麼不javac一下就知道了呢... @@ 07/22 01:11
→ Killercat:還有compile time error根本連bug都還沒資格稱上呢 orz 07/22 01:12
→ NullLife:不懂你要問什麼? "感覺跟原先想的想法好像沒多大差異"? 07/22 01:16
推 NullLife:你預期他的結果怎麼樣都沒說 要別人怎麼回應你呢@@? 07/22 01:21
推 floathru:他預期的結果就是可以跑然後印出那一行字啊XD 07/22 02:11
→ floathru:剛開始學還是用個IDE吧 07/22 02:13
→ NullLife:我知道他想幹嘛,我只是想讓他知道該如何發問 07/22 02:20
→ NullLife:而且其實這東西看起來就像是功課... 07/22 02:21
推 cpper:題目沒貼完整, 零分 07/22 03:10
→ cpper:What is the result? 07/22 03:10
→ cpper:A. class A 07/22 03:11
→ cpper:B. Compilation fails. 07/22 03:11
→ cpper:C. An exception is thrown at line 2. 07/22 03:11
→ cpper:D. An exception is thrown at line 6. 07/22 03:11
→ cpper:E. The code executes with no output. 07/22 03:11
→ cpper:Answer:E 07/22 03:11
推 NullLife:樓上是教授嗎 XD 07/22 09:31
→ cpper:不是 只是複製題目貼到google看到的 XD 07/22 10:55
推 oscaroec:XD c教授 07/22 12:40
推 Killercat:其實這似乎也是少數Java/C++差異很大的地方 07/22 12:42
→ Killercat:C++ constructor前面多個void編譯就會炸掉 不會給你有 07/22 12:43
→ Killercat:機會當成class function(method)的.... 07/22 12:43
新手自學,請別鞭我,善用網路資源學習~"~
※ 編輯: APE36 (114.39.11.48), 07/22/2014 12:52:33
推 gmoz:記得排版XD 07/22 17:04