电子科技大学计算机科学与技术专业《面向对象程序设计》作业及答案2
A.用来调用父类的构造方法
B.用来调用父类中被重载的方法
C.用来访问父类被隐藏的成员变量
D.以上都是
D
A.java.lang
B.java.io
C.java.awt
D.java.applet
A
A.{public String toString(){return 4+"";}}
B.class B extends A
C.{public String toString(){return super.toString()+3;}}
D.public class Test
E.{public static void main(String[]args)
F.{B b=new B();System.out.println(b.toString());} }
G.what is the result。()
H.the program throw an exception
I.null
J.7
.43
D
A.public
B.interface
C.final
D.abstract
A
A.以上语句都不会
B.s.substring(3);
C.s.concat("y");
D.s.append("x");
A
A.synchronized()
B.start()
C.run()
D.init()
C
A.采用不同的形式参数列表(形式参数的个数、类型、顺序不完全相同)
B.返回值的数据类型不同
C.调用时用类名或对象名做前缀
D.形式参数名不同
A
A.Throwable
B.Exception
C.Error
D.AWTError
B
A.true
B.false
C.1
A
A.调用对象方法时
B.类定义时
C.创建对象时
D.使用对象的变量时
C
A.setMenuBar()
B.setMenu()
C.addMenuBar()
D.add()
A
A.javaprof.exe
B.java.exe
C.javadoc.exe
D.jdb.exe
D
A.2.5
B.3
C.2
D.2.0
C
A.GridLayout
B.FlowLayout
C.CardLayout
D.BorderLayout
D
A.java.lang
B.java.io
C.java.awt
D.java.applet
A
A.public void example( int m){...}
B.public void example2(int k){...}
C.public int example( int m, float f){...}
D.public int example(int k){...}
A.//one
B.{if(unsafe()){//do something …}
C.else if(safe()){//do the other …}
D.}
E.The method unsafe() will throw an IOException, which completes the method of declaration when added at line one。()
F.public void methodName() throws IOException
G.public void methodName() throw IOException
H.public void methodName()
I.public IOException methodName()
A.a
B.10
C.1
D.0xa