奥鹏电子科大17秋《面向对象程序设计》在线作业1 试卷总分:100 测试时间:-- 单选题 判断题 、单选题(共 20 道试题,共 80 分。) 1. 向容器添加新构件的方法是 A. add() B. insert() C. hill() D. set() 满分:4 分 2. 对于catch子句的排列,下列是正确的。 A. 父类在先,子类在后 B. 子类在先,父类在后 C. 有继承关系的异常不能在同一个try结构程序段内 D. 排列顺序可任意 满分:4 分 3. 已知如下代码: public class Test{ static long a[] = new long[10]; public static void main ( String arg[] ) { ( a[6] ); } } 则下面个语句是正确的。 A. Output is null. B. pile, some error will occur. C. Output is 0. D. When running, some error will occur. 满分:4 分 4. Java语言的许多特点中,下列特点是C++语言所不具备的。 A. 高性能 B. 跨平台 C. 面向对象 D. 有类库 满分:4 分 5. 当方法遇到异常又不知如何处理时,应该 A. 捕获异常 B. 抛出异常 C. 用throws声明异常 D. 嵌套异常 满分:4 分 6. public class X extends Frame{ public static void main(String[] args){ X x=new X();();(true); } public X(){ setLayout(new GridLayout(2,2)); Panel p1=new Panel(); add(p1); Button b1 A. all change height and width B. Button One change height C. Button Two change height and Button Three change width D. Button Four change height and width 满分:4 分 7. 下面语句是创建数组的正确语句。 A. float f[5][6] = new float[5][6]; B. float []f[] = new float[5][6]; C. float f[5][] = new float[][6]; D. float [5][]f = new float[5][6]; 满分:4 分 8. class Super{public float getNum(){return ;}} public class Sub extends Super{ //overload } which method, placed at overload, will cause piler error? A. public float getNum(){retu