电子科技大学《JAVA程序设计》在线作业一

奥鹏电子科技大学平时在线作业

18春《JAVA程序设计》在线作业1-0001

下列语句的输出结果是 。public class A{public static void main(String[]args){System.out.println(21);}}
A:true
B:false
C:1
D:0
答案问询微信:424329

构造方法在 时候被调用。
A:类定义时
B:创建对象时
C:调用对象方法时
D:使用对象的变量时
答案问询微信:424329

下列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{}
答案问询微信:424329

下列代码的执行结果是 。public class A{public static void main(String[]args){System.out.println(5/2);}}
A:2.5
B:2.0
C:3
D:2
答案问询微信:424329

在Java的基本数据类型中,int型数据占用 字节内存空间。
A:1
B:2
C:4
D:不能确定,取决于计算机字长
答案问询微信:424329

在Java中, 语句作为异常处理的统一出口。
A:throw
B:try
C:finally
D:catch
答案问询微信:424329

下列Java常见事件类中 是鼠标事件类。
A:InputEvent
奥鹏电子科技大学平时在线作业B:KeyEvent
C:MouseEvent
D:WindowEvent
答案问询微信:424329

下列关于接口的叙述中, 是正确的。
A:接口与抽象类是相同的概念
B:接口之间不能有继承关系
C:一个类只能实现一个接口
D:接口中只含有抽象方法和常量
答案问询微信:424329

以下 可能包含菜单条。
A:Panel
B:Applet
C:Dialog
D:Frame
答案问询微信:424329

下面 函数是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){…}
答案问询微信:424329

如下 字符串是Java中合法的用户自定义标识符。
A:super
B:3number
C:#number
D:$number
答案问询微信:424329

下列叙述错误的是
A:Java是一种面向对象的网络编程语言
B:Java Applet程序在网络上传输不受硬软件平台的限制
C:Java提供了类库支持TCP/IP协议
D:Java语言允许使用指针访问内存
答案问询微信:424329

在Java中,用 关键字定义常量。
A:define
B:fixed
C:const
D:final
答案问询微信:424329

下面是类A的构造函数声明,其中正确的是
A:void A(int x){…}
B:A(int x){…}
C:a(int x){…}
D:void a(int x){…}
答案问询微信:424329

若在某一个类定义中定义有方法:abstract void f();则该类是
A:public类
B:final类
C:抽象类
D:不能确定
答案问询微信:424329

布局管理器使容器中各个构件呈网格布局,平均占据容器空间。
A:CardLayout
B:BorderLayout
C:FlowLayout
D:GridLayout
答案问询微信:424329

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
答案问询微信:424329

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
答案问询微信:424329

Java语言的许多特点中,下列 特点是C++语言所不具备的。
A:高性能
B:跨平台
C:面向对象
D:有类库
答案问询微信:424329

Java Application源程序文件的扩展名为
A:.java
B:.class
C:.html
D:.exe
答案问询微信:424329

( )A class can implement as many interfaces as needed.
A:错误
B:正确
答案问询微信:424329

( )如果p是父类Parent的对象,而c是子类Child的对象,则语句c = p是正确的。
A:错误
B:正确
答案问询微信:424329

( )字符串分为两大类,一类是字符串常量,使用StringBuffer类的对象表示;另一类是字符串变量,使用String类的对象表示。
A:错误
B:正确
答案问询微信:424329

( )抽象方法必须在抽象类中,所以抽象类中的方法都必须是抽象方法。
A:错误
B:正确
答案问询微信:424329

( )A subclass inherits all methods ( including the constructor ) from the superclass.
A:错误
B:正确
答案问询微信:424329

提供优质的教育资源

公众号: 超前自学网