3857试题六(共15分)阅读下列说明和Java代码,将应填入 (n) 处的字句写在答题纸的对应栏内。【说明】某发577

题目详情
试题六(共15分) 阅读下列说明和Java代码,将应填入 (n) 处的字句写在答题纸的对应栏内。 【说明】 某发票(lnvoice)由抬头(Head)部分、正文部分和脚注(Foot)部分构成。现采用装饰(Decorator)模式实现打印发票的功能,得到如图6-1所示的类图。 【java代码】 class invoice{ public void printInvoice(){: System.out.println ("This is the content of the invoice!"); } } class Decorator : extends Invoice { protected Invoice ticket; public Decorator(lnvoice t){ ticket = t; } public void printinvoice(){ if(ticket != NULL) (1); } } class FootDecorator extends Decorator{ public FootDecorator(lnvoice t){ super(t); } public void printinvoice (){ Systent.out.println("This is the header of the invoice! "); (2) ; } } class FootDecorator extends Decorator { public FootDecorator(invoice t):{ super(t); } public void printlnvoice(){ (3) ; Systent.out.println("This is the header of the invoice! "); } } Class test { public static void main(string[] args){ Invoice t =new invioce(); Invoice ticket; Ticket= (4) ; Ticket. Printinvoice(); Systent.out.println(“--------------“) Ticket= (5) ; Ticket. Printinvoice(); } } 程序的输出结果为: This is the header of the invoice! This is the content of the invoice! This is the footnote of the invoice! ---------------------------- This is the header of the invoice! This is the footnote of the invoice! 请帮忙给出正确答案和分析,谢谢!
题目答案
题目解析⬇️小程序搜题更方便
推荐题目
3349下列哪些违纪行为属于违反中央八项规定精神:()A.乱收费B.违规收送礼品礼金C.违规发放津贴补贴D2930
963实行“一案双查”,既要追究当事人责任,又要倒查追究相关领导责任,包括党委的主体和纪委的监督责1358
488人们可以通过()、()、()、()等方法,来发掘人的思维潜能。A.提高认识B.学习技巧C.培养感受力领悟4621
3827试题五(共15分)阅读下列说明和C++-代码,将应填入 (n) 处的字句写在答题纸的对应栏内。【说明】某发7249
6215党风廉政建设“两个责任”是指在落实党风廉政建设责任制过程中,纪委负主体责任,党委负监督责任。541
2416重大事项集体决策“三个必须”是指:()A.决策的事项、内容和程序必须事先设定B.决策必须经集体讨论8486
1956根据《标准施工招标文件》,当重新招标时评标委员会否决所有投标,招标人应当()。A.再次发布招标公7296
2454简述四肢关节退行性骨关节病的X线表现。9332
观察膝关节前后交叉韧带撕裂,首选下列哪项检查:()A.CT扫描B.CT膝关节造影C.MRID.超声E.平片
6024根据《嵊州市机关工作人员问责追责实施办法(试行)》规定,机关工作人员受下列哪种问责追究,当年度2092
5“一岗双责”:“一岗”就是一个领导干部的职务所对应的岗位;“双责”就是一个领导干部既要对所在岗位5779
1334两名国企职工准备结婚,根据《嵊州市党员干部操办婚丧、喜庆事宜若干规定(试行)》关于婚宴酒席不超2269
2222简述化脓性关节炎的X线诊断。5188
3259工程投标时,投标保证金对投标人具有约束力的期限是()。A.申请资格预审日起,至开标日止B.购买招4557
1357党的规矩包括:()A.党章B.党的纪律C.国家法律D.党的优良传统和工作惯例5866
最新题库