看板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》 ◣◣◢ ─╯