| 
 | 
 
19春《JAVA程序设计》在线作业3 
1.[单选题]实现下列         接口可以对TextField对象的事件进行监听和处理。 
奥鹏19春在线答案 
奥鹏电子科技大学 
    A.ActionListener 
    B.FocusListener 
    C.MouseMotionListener 
    D.WindowListener 
    正确答案:——A—— 
2.[单选题]下列         是Java的调试器,如果编译器返回程序代码的错误,可以用它对程序进行调试。 
    A.java.exe 
    B.javadoc.exe 
    C.jdb.exe 
    D.javaprof.exe 
    正确答案:——C—— 
3.[单选题]容器Panel和Applet默认使用的布局管理器是 
    A.CardLayout 
    B.BorderLayout 
    C.FlowLayout 
    D.GridLayout 
    正确答案:——C—— 
4.[单选题]下列语句输出结果为         。public class A{public static void main(String[]args){byte b=0xa;System.out.println(b);}}    奥鹏答案 
奥鹏电子科技大学 
    A.0xa 
    B.a 
    C.1 
    D.10 
    正确答案:———— 
5.[单选题]Give the following java class: 
public class Example 
{public static void main(String args[]) 
  {int x[] = new int[15];System.out.println(x[5]);} 
} 
Which statement is corrected? 
    A.When compile, some error will occur. 
    B.When run, some error will occur. 
    C.Output is zero. 
    D.Output is null. 
    正确答案:———— 
6.[单选题]Which modifer should be applied to a declaration of a class member variable for the value of variable to remain constant after the creation of the object? 
    A.static 
    B.final 
    C.const 
    D.abstract 
    正确答案:———— 
7.[单选题]下列         不是Java的保留字。 
    A.do 
    B.double 
    C.sizeof 
    D.while 
    正确答案:———— 
8.[单选题]类是所有异常类的父类。 
    A.Throwable 
    B.Error 
    C.Exception 
    D.AWTError 
    正确答案:———— 
9.[单选题]若在某一个类定义中定义有方法:abstract void f();则该类是 
    A.public类 
    B.final类 
    C.抽象类 
    D.不能确定 
    正确答案:———— 
10.[单选题]A class design requires that a member variable should be accessible only by same package, which modifer word should be used? 
    A.protected 
    B.public 
    C.no modifer 
    D.private 
    正确答案:———— 
11.[单选题]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 
    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 
    正确答案:———— 
12.[单选题]Thread类的方法中,toString()方法的作用是 
    A.只返回线程的名称 
    B.返回当前线程所属的线程组的名称 
    C.返回当前线程对象 
    D.返回线程的字符串信息 
    正确答案:———— 
13.[单选题]构造方法在         时候被调用。 
    A.类定义时 
    B.创建对象时 
    C.调用对象方法时 
    D.使用对象的变量时 
    正确答案:———— 
14.[单选题]如下             方法可以将MenuBar加入Frame中。 
    A.setMenu() 
    B.setMenuBar() 
    C.add() 
    D.addMenuBar() 
    正确答案:———— 
15.[单选题]下列常见的系统定义的异常中,         是数组下标越界异常。 
    A.ArithmeticException 
    B.IOException 
    C.ArrayIndexOutOfBoundsException 
    D.NullPointerException 
    正确答案:———— 
16.[单选题]下列关于接口的叙述中,         是正确的。 
    A.接口与抽象类是相同的概念 
    B.接口之间不能有继承关系 
    C.一个类只能实现一个接口 
    D.接口中只含有抽象方法和常量 
    正确答案:———— 
17.[单选题]下列叙述中,         是正确的。 
    A.类是变量和方法的集合体 
    B.数组是无序数据的集合 
    C.抽象类可以实例化 
    D.类成员数据必须是公有的 
    正确答案:———— 
18.[单选题]在Java中,用         关键字定义常量。 
    A.define 
    B.fixed 
    C.const 
    D.final 
    正确答案:———— 
19.[单选题]有类定义:abstract class A{public abstract void f();}下面关于该类的描述中正确的是 
    A.该类可以用new A();实例化一个对象 
    B.该类不能被继承 
    C.该类的方法不能被重载 
    D.以上说法都不对 
    正确答案:———— 
20.[单选题]若要抛出异常,应该使用下列         子句。 
    A.catch 
    B.throw 
    C.try 
    D.finally 
    正确答案:———— 
21.[判断题](   )final类中的属性和方法都必须被final修饰符修饰。 
    A.错误 
    B.正确 
    正确答案:———— 
22.[判断题](   )有的类定义时可以不定义构造函数,所以构造函数不是必需的。 
    A.错误 
    B.正确 
    正确答案:———— 
23.[判断题](   )用“+”可以实现字符串的拼接,用“-”可以从一个字符串中去除一个字符子串。 
    A.错误 
    B.正确 
    正确答案:———— 
24.[判断题](   )Java的屏幕坐标是以像素为单位,容器的左下角被确定为坐标的起点。 
    A.错误 
    B.正确 
    正确答案:———— 
25.[判断题](   )字符串分为两大类,一类是字符串常量,使用StringBuffer类的对象表示;另一类是字符串变量,使用String类的对象表示。 
    A.错误 
    B.正确 
    正确答案:———— 
奥鹏作业答案 
奥鹏电子科技大学 
 |   
 
 
 
 |