电子科技大学计算机科学与技术专业《面向对象程序设计》作业及答案1
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
C
A.static
B.final
C.abstract
D.No modifier can be used
B
A.不能确定,取决于计算机字长
B.4
C.2
D.1
B
A.void
B.int
C.char
D.String
A
A.UnknownHostException
B.IOException
C.FileNotFoundException
D.ClassNotFoundException
B
A.public class X extends Frame{
B.public static void main(String[] args){
C.X x=new X();x.pack();x.setVisible(true);
D.}
E.public X(){
F.setLayout(new GridLayout(2,2));
G.Panel p1=new Panel(); add(p1);
H.Button b1=new Button("One"); p1.add(b1);
I.Panel p2=new Panel(); add(p2);
J.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, ()
.all change height and width
.Button Two change height and Button Three change width
.Button One change height
.Button Four change height and width
D
A.WindowEvent
B.MouseEvent
C.KeyEvent
D.InputEvent
B
A.public
B.protected
C.private和protected
D.private
A
A.fixed
B.final
C.#define
D.const
B
A.无修饰符
B.public
C.protected
D.private
A
A.all change height and width
B.Button Two change height and Button Three change width
C.Button One change height
D.Button Four change height and width
D
A.接口之间不能有继承关系
B.接口中只含有抽象方法和常量
C.接口与抽象类是相同的概念
D.一个类只能实现一个接口
B
A.不能确定,取决于计算机字长
B.4
C.2
D.1
B
A.a
B.10
C.1
D.0xa
B
A.程序预先定义好的异常事件
B.程序编译错误
C.程序编译或运行中所发生的异常事件
D.程序的语法错
C
A.public void getNum(double d){}
B.public void getNum(){}
C.public float getNum(){return 4.0f;}
D.public double getNum(float d){return 4.0d;}
A.When running, some error will occur.
B.When compile, some error will occur.
C.Output is null.
D.Output is 0.
A.Java语言允许使用指针访问内存
B.Java是一种面向对象的网络编程语言
C.Java提供了类库支持TCP/IP协议
D.Java Applet程序在网络上传输不受硬软件平台的限制