看板java
標 題Re: [問題] 關於建構子與繼承
發信站不良牛牧場 (Tue Sep 12 16:02:13 2006)
轉信站ptt!ctu-reader!Spring!news.nctu!news.nsysu!news.isu!News.a6Crazy.twbbs
※ 引述《[email protected] (阿薩布魯‧湖瀾)》之銘言:
: class A{
: private int x,y;
: A(int x, int y){
由於有任一明確的constructor存在, 不會有default constructor
: this.x=x;this.y=y;}
: void printXY(){System.out.print("A: x=" + x + ", y=" + y);}
: }
: =============================================================
: 上面的程式碼為什麼會產生找不到class A的Constructor的compile error?
: 不是應該會有 Default Constructor 嗎?
--
╭──── Origin:
<不良牛牧場> bbs.badcow.com.tw (210.200.247.200)─────╮
│ ↘ Welcome to SimFarm BBS -- From : [210.64.83.245] │
╰◣◣◢ ◢◢《不良牛免費撥接→電話:40586000→帳號:zoo→密碼:zoo》 ◣◣◢ ─╯