- 1、本文档共9页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
Word文档下载后可自行编辑
电科20 春《面对对象程序设计》在
线作业1
20 春《面向对象程序设计》在线作业 1
试卷总分:100 得分:100
一、单选题 (共 20 道试题,共 80 分)
class A {public int getNumber(int a){return a+1;}}
class B extends A {public int getNumber(int a,
char c){return a+2;} public static void
main(String args) {B b=new
B();System.out.println(b.getNumber(0));} } what
is the result?
A.compilation succeeds and 3 is printed
B.compilation succeeds and 2 is printed
C.compilation succeeds and 1 is printed
D.An error at this program cause compilation to
fail
以下( )约束符可用于定义成员常量。
A.static
1 / 9
Word文档下载后可自行编辑
B.final
C.abstract
D.No?modifier?can?be?used
在 Java 的基本数据类型中,int 型数据占用
() 字节内存空间。
A.不能确定,取决于计算机字长
B.4
C.2
D.1
4.Java中main()函数的值 。
A.void
B.int
C.char
D.String
下列常见的系统定义的异常中,()是输入、
输出异常。
A.UnknownHostException
B.IOException
C.FileNotFoundException
2 / 9
Word文档下载后可自行编辑
D.ClassNotFoundException
import java.awt.*;
public class X extends Frame{
public static void main(String args){
X x=new X();x.pack();x.setVisible(true);
}
public X(){
setLayout(new GridLayout(2,2));
Panel p1=new Panel(); add(p1);
Button b1=new Button(One); p1.add(b1);
Panel p2=new Panel();add(p2);
Button b2=new Button(Two); p2.add(b2);
Button b3=new Button(Three); p2.add(b3);
Button b4=new Button(Four); add(b4);
}
}
when the frame is resized,
A.all change height and width
B.Button Two change height and Button Three
change width
C.Button One change height
3 / 9
Word文档下载后可自行编辑
D.Button Four change height and width
下列Java 常见事件类中()是鼠标事件类。
A.WindowEvent
B.MouseEvent
C.KeyEvent
D.InputEvent
8.在使用 interface 声明一个接口时,只可以
使用 修饰符修饰该接口。
A.public
B.protected
专注于中小学教案的个性定制:修改,审批等。本人已有2年教写相关工作经验,具有基本的教案定制,修改,审批等能力。可承接教案,读后感,检讨书,工作计划书等多方面的个性化服务。欢迎大家咨询^
文档评论(0)