Re: [問題] 關於建構子與繼承
※ 引述《Taique.bbs@ptt.cc (阿薩布魯‧湖瀾)》之銘言:
: 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》 ◣◣◢ ─╯
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 3 之 4 篇):
java 近期熱門文章
PTT數位生活區 即時熱門文章