电子科技大19春《JAVA程序设计》在线作业123

作者:周老师 分类: 电子科技大学 发布时间: 2019-07-10 16:27

专业辅导各院校在线、离线考核、形考、终极考核、统考、社会调查报告、毕业论文写作交流等!

联系我们:QQ客服:3326650399   439328128    微信客服①:cs80188     微信客服②:cs80189

              扫一扫添加我为好友                           扫一扫添加我为好友

支付宝微信钱包

19春《JAVA程序设计》在线作业1

1.[单选题]下列语句的输出结果是         。public class A{public static void main(String[]args){System.out.println(2>1);}}
     A.true    B.false
     C.1
     D.0
     正确答案:——A——
2.[单选题]构造方法在         时候被调用。
     A.类定义时
     B.创建对象时
     C.调用对象方法时
     D.使用对象的变量时
     正确答案:——B——
3.[单选题]下列Java源文件代码片段中,         是不正确的。
     A.package t;public class A{}
     B.import java.io.*;package t;public class A{}
     C.import java.io.*;class A{}public class B{}
     D.import java.io.*;import java.awt.*;public class A{}
     正确答案:——B——
4.[单选题]下列代码的执行结果是         。public class A{public static void main(String[]args){System.out.println(5/2);}}
     A.2.5
     B.2.0
     C.3
     D.2
     正确答案:————
5.[单选题]在Java的基本数据类型中,int型数据占用         字节内存空间。
     A.1
     B.2
     C.4
     D.不能确定,取决于计算机字长
     正确答案:————
6.[单选题]在Java中,         语句作为异常处理的统一出口。
     A.throw
     B.try
     C.finally
     D.catch
     正确答案:————
7.[单选题]下列Java常见事件类中            是鼠标事件类。
     A.InputEvent
     B.KeyEvent
     C.MouseEvent
     D.WindowEvent
     正确答案:————
8.[单选题]下列关于接口的叙述中,         是正确的。
     A.接口与抽象类是相同的概念
     B.接口之间不能有继承关系
     C.一个类只能实现一个接口
     D.接口中只含有抽象方法和常量
     正确答案:————
9.[单选题]以下         可能包含菜单条。
     A.Panel
     B.Applet
     C.Dialog
     D.Frame
     正确答案:————
10.[单选题]下面         函数是public void example(int k){...}的重载函数。
     A.public void example( int m){...}
     B.public int example(int k){...}
     C.public void example2(int k){...}
     D.public int example( int m, float f){...}
     正确答案:————
11.[单选题]如下        字符串是Java中合法的用户自定义标识符。
     A.super
     B.3number    
     C.#number
     D.$number
     正确答案:————
12.[单选题]下列叙述错误的是
     A.Java是一种面向对象的网络编程语言
     B.Java Applet程序在网络上传输不受硬软件平台的限制
     C.Java提供了类库支持TCP/IP协议
     D.Java语言允许使用指针访问内存
     正确答案:————
13.[单选题]在Java中,用         关键字定义常量。
     A.define
     B.fixed
     C.const
     D.final
     正确答案:————
14.[单选题]下面是类A的构造函数声明,其中正确的是
     A.void A(int x){...}
     B.A(int x){...}
     C.a(int x){...}
     D.void a(int x){...}
     正确答案:————
15.[单选题]若在某一个类定义中定义有方法:abstract void f();则该类是
     A.public类
     B.final类
     C.抽象类
     D.不能确定
     正确答案:————
16.[单选题]布局管理器使容器中各个构件呈网格布局,平均占据容器空间。
     A.CardLayout
     B.BorderLayout
     C.FlowLayout
     D.GridLayout
     正确答案:————
17.[单选题]public class Test{
       public static void main(String[] args){
         String a=args[1];String b=args[2];String c=args[3];
       }
     }
execute command:java Test Red Green Blue
what is the value of c?
     A.c has value of null
     B.c has value of Blue
     C.the code does not compile
     D.the program throw an exception
     正确答案:————
18.[单选题]Give incompleted method:
//one
{if(unsafe()){//do something…}
else if(safe()){//do the other…}
}
The method unsafe() will throw an IOException, which completes the method of declaration when added at line one?
     A.public IOException methodName()
     B.public void methodName()
     C.public void methodName() throw IOException
     D.public void methodName() throws IOException
     正确答案:————
19.[单选题]Java语言的许多特点中,下列         特点是C++语言所不具备的。
     A.高性能
     B.跨平台
     C.面向对象
     D.有类库
     正确答案:————
20.[单选题]Java Application源程序文件的扩展名为
     A..java
     B..class
     C..html
     D..exe
     正确答案:————
21.[判断题](   )A class can implement as many interfaces as needed.
     A.错误
     B.正确
     正确答案:————
22.[判断题](   )如果p是父类Parent的对象,而c是子类Child的对象,则语句c = p是正确的。
     A.错误
     B.正确
     正确答案:————
23.[判断题](   )字符串分为两大类,一类是字符串常量,使用StringBuffer类的对象表示;另一类是字符串变量,使用String类的对象表示。
     A.错误
     B.正确
     正确答案:————
24.[判断题](   )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。
     A.错误
     B.正确
     正确答案:————
25.[判断题](   )A subclass inherits all methods ( including the constructor ) from the superclass.
     A.错误
     B.正确
     正确答案:————
19春《JAVA程序设计》在线作业2
1.[单选题]下列叙述中不正确的是
     A.abstract不能与final并列修饰同一个类
     B.abstract类中不可以有private的成员
     C.abstract方法必须在abstract类中
     D.static方法中能直接处理非static的属性
     正确答案:——D——
2.[单选题]在Java中,子类重新定义一个与从父类那里继承来的域变量(成员变量)完全相同的变量,这称为域的
     A.隐藏
     B.覆盖
     C.重载
     D.Java不支持此特性
     正确答案:——B——
3.[单选题]在Java的基本数据类型中,int型数据占用         字节内存空间。
     A.1
     B.2
     C.4
     D.不能确定,取决于计算机字长
     正确答案:——C——
4.[单选题]下列常见的系统定义的异常中,         是数组下标越界异常。
     A.ArithmeticException
     B.IOException
     C.ArrayIndexOutOfBoundsException
     D.NullPointerException
     正确答案:————
5.[单选题]在Java语言中,         包是自动导入的。
     A.java.lang
     B.java.awt
     C.java.applet
     D.java.io
     正确答案:————
6.[单选题]在Java中,         语句作为异常处理的统一出口。
     A.throw
     B.try
     C.finally
     D.catch
     正确答案:————
7.[单选题]What happens when you try to compile and run the following program?          
class Mystery{String s;
   public static void main(String[] args){
Mystery m=new Mystery();m.go();}
   void Mystery(){s="constructor";}
   void go(){System.out.println(s);}
}
     A.this code will not compile
     B.this code compliles but throws an exception at runtime
     C.this code runs and "constructor" in the standard output
     D.this code runs and writes "null" in the standard output
     正确答案:————
8.[单选题]Java语言中,         是所有类的根类。
     A.Object
     B.Root
     C.Thread
     D.Applet
     正确答案:————
9.[单选题]Java源文件中最多只能有一个         类,其他类的个数不限。
     A.abstract
     B.public
     C.final
     D.interface
     正确答案:————
10.[单选题]下列         是创建一个标识有“OK”的按钮的语句。
     A.TextField b=new TextField("OK");
     B.Button b=new Button("OK");
     C.TextArea b=new TextArea("OK");
     D.Checkbox b=new Checkbox("OK");
     正确答案:————
11.[单选题]下列         是不合法的标识符。
     A._book
     B.3file
     C.$good
     D.a_$2
     正确答案:————
12.[单选题]下列关于继承的叙述中,         是正确的。
     A.子类能继承父类的所有方法和状态
     B.子类能继承父类的非私有方法和状态
     C.子类只能继承父类的public方法和状态
     D.子类只能继承父类的方法,而不继承状态
     正确答案:————
13.[单选题]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 1 is printed
     B.compilation succeeds and 2 is printed
     C.compilation succeeds and 3 is printed
     D.An error at this program cause compilation to fail
     正确答案:————
14.[单选题]下列保留字中书写正确的是
     A.Case
     B.For
     C.try
     D.viod
     正确答案:————
15.[单选题]创建字符串s:String s=new String("abcd");以下         将改变s。
     A.s.append("x");
     B.s.concat("y");
     C.s.substring(3);
     D.以上语句都不会
     正确答案:————
16.[单选题]下列代码的执行结果是         。public class A{public static void main(String[]args){System.out.println(5/2);}}
     A.2.5
     B.2.0
     C.3
     D.2
     正确答案:————
17.[单选题]监听器接口的方法返回值是
     A.int
     B.String
     C.void
     D.Object
     正确答案:————
18.[单选题]一个Java Application运行后,在系统中是作为一个
     A.线程
     B.进程
     C.进程或线程
     D.不可预知
     正确答案:————
19.[单选题]有类定义:abstract class A{public abstract void f();}下面关于该类的描述中正确的是
     A.该类可以用new A();实例化一个对象
     B.该类不能被继承
     C.该类的方法不能被重载
     D.以上说法都不对
     正确答案:————
20.[单选题]下列命令中,         命令是Java的编译命令。
     A.javac
     B.java
     C.javadoc
     D.appletviewer
     正确答案:————
21.[判断题](   )Java的各种数据类型占用固定长度,与具体的软硬件平台环境无关。
     A.错误
     B.正确
     正确答案:————
22.[判断题](   )Java程序里,创建新的类对象用关键字new,回收无用的类对象使用关键字free。
     A.错误
     B.正确
     正确答案:————
23.[判断题](   )在Java语言中,系统常量null,false,true既可以大写,也可以小写。
     A.错误
     B.正确
     正确答案:————
24.[判断题](   )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。
     A.错误
     B.正确
     正确答案:————
25.[判断题](   )子类要调用父类的方法,必须使用super关键字。
     A.错误
     B.正确
     正确答案:————
19春《JAVA程序设计》在线作业3
1.[单选题]实现下列         接口可以对TextField对象的事件进行监听和处理。
     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.正确
     正确答案:————

专业辅导各院校在线、离线考核、形考、终极考核、统考、社会调查报告、毕业论文写作交流等!(非免费)

联系我们:QQ客服:3326650399   439328128    微信客服①:cs80188     微信客服②:cs80189

               扫一扫添加我为好友                           扫一扫添加我为好友

支付宝微信钱包