当前位置:大学生在线网大学生专栏考试计算机等级考试试题计算机二级考试试题2007年4月计算机等级考试二级Java真题2

2007年4月计算机等级考试二级Java真题2

10-27 17:54:54  浏览次数:0次  栏目:计算机二级考试试题
标签:计算机二级考试真题,计算机二级考试试题, 2007年4月计算机等级考试二级Java真题2,http://www.dxs89.com

感谢大家对本系列文章的关注,本章我们将继续为正在备考计算机等级考试的同学提供《2007年4月计算机等级考试二级Java真题》系列内容,以下是本章的第二部分:

2007年4月计算机等级考试二级Java真题

(21)给出下列代码,则数组初始化中哪项是不正确的?
byte[] array1,array2[];
byte array3[][];
byte [][] array4;
a.array2 = array1
b.array2=array3
c.array2=array4
d.array3=array4

(22)下列代码的执行结果是
public class test
{
public int amethod()
{
static int i=0;
i++;
system.out.println(i);
}
public static void main(string args[])
{
test test = new test();
test.amethod();
}
}
a.编译错误
b.0
c.1
d.运行成功,但不输出

(23)下列关于内部类的说法不正确的是
a.内部类的类名只能在定义它的类或程序段中或在表达式内部匿名使用
b.内部类可以使用它所在类的静态成员变量和实例成员变量
c.内部类不可以用abstract修饰符定义为抽象类
d.内部类可作为其他类的成员,而且可访问它所在类的成员

(24)顺序执行下列程序语句后,则b的值是
string a="hello";
string b=a.substring(0,2);
a.hello
b.hello
c.hel
d.null

www.dxs89.com

(25)在onemethod()方法运行正常的情况下,程序段将输出什么?
public void test()
{
try { onemethod();
system.out.println("condition 1");
} catch (arrayindexoutofboundsexception e)
{
system.out.println("condition 2");
} catch(exception e)
{
system.out.println("condition 3");
} finally
{
system.out.println("finally");
}
}
a.condition 1
b.condition 2
c.condition 3
d.condition 1
finally

(26)下列常见的系统定义的异常中,哪个是输入、输出异常?
a.classnotfoundexception
b.ioexception
c.filenotfoundexception
d.unknownhostexception

(27)下列哪个不是nio包的新特点?
a.内存映射技术
b.文件锁定
c.字符及编码
d.阻塞i/o

(28)下列哪个选项是正确计算42度(角度)的余弦值?
a.double d=math.cos(42);
b.double d=math.cosine(42);
c.double d=math.cos(math.toradians(42));
d.double d=math.cos(math.todegrees(42));

www.dxs89.com

(29)下列inputstream类中哪个方法可以用于关闭流?
a.skip()
b.close()
c.mark()
d.reset()

(30)下列方法中哪个是执行线程的方法?
a.run()
b.start()
c.sleep()
d.suspend()

(31)下列关于frame类的说法不正确的是 
a.frame是window类的直接子类 
b.frame对象显示的效果是一个窗口 
c.frame被默认初始化为可见 
d.frame的默认布局管理器为borderlayout 
(32)下列java常见事件类中哪个是鼠标事件类? 
a.inputevent 
b.keyevent 
c.mouseevent 
d.windowevent 

(33)在applet的关键方法中,下列哪个方法是关闭浏览器以释放applet占用的所有资源? 
a.init() 
b.start() 
c.paint() 
d.destroy() 

www.dxs89.com

(34)下列哪个是面向大型企业级用容器管理专用构件的应用平台? 
a.j2ee 
b.j2me 
c.j2se 
d.j2de 

(35)下列哪个选项的java源文件代码片段是不正确的? 
a.package testpackage; 
public class test{ }

b.import java.io.*; 
package testpackage; 
public class test{ } 

c.import java.io.*; 
class person{ } 
public class test{ } 

d.import java.io.*; 
import java.awt.*; 
public class test{ } 

以上就是考试百科为大家提供的《2007年4月计算机等级考试二级Java真题》的第二部分内容,本套试题的填空题将在第三部分为大家提供,不要错过哦。

*******************************************************************
【友情推荐】:2007年4月计算机等级考试二级Java真题1
【友情推荐】:2007年4月计算机等级考试二级Java真题3

,2007年4月计算机等级考试二级Java真题2