- 1
- 0
- 约7.96千字
- 约 36页
- 2017-08-27 发布于上海
- 举报
this 關鍵字 可以透過 this,呼叫相同類別底下的另一個建構元 public class AClass { private int x, y; private int width, height; public AClass(){ this(0,0,0,0); } public AClass(int width, int height){ this(0,0,width,height); } public AClass(int x, int y, int width, int height){ this.x = x; this.y = y; this.width = width; this.height = height; } ... } this 關鍵字 具有二個建構元的 Box 類別 class Box { double width, height, depth; // 預設的建構元 Box() { this(1, 2, 3); } // 可以自行指定長寬的建構元 Box(int width, int height, int depth){ this.width = width; this.height = height; this.depth = depth; } } this 關鍵字 Exam
您可能关注的文档
最近下载
- 粘胶去除剂(中文).pdf VIP
- 2026校招:江苏国金资本运营集团试题及答案.doc VIP
- 江苏国金资本运营集团校招面笔试题及答案.doc VIP
- 《数据分析与应用》课件.ppt VIP
- 2026江苏国金资本运营集团秋招试题及答案.doc VIP
- 2025年3月天一联考高二作文审题指导和范文:精神胜利法.docx VIP
- 2026年河南应用技术职业学院单招职业适应性考试模拟测试卷附答案.docx VIP
- 最新Multisim+14.3汉化破解版下载附详细安装教程.pdf VIP
- 湖北宜昌市2026届高三3月调研考试生物试题(试卷+解析).docx VIP
- 2024-2025学年厦门一检初三英语试卷及答案.pdf VIP
原创力文档

文档评论(0)