您好,欢迎光临本网站![请登录][注册会员]  
文件名称: Java测试题3答案
  所属分类: Java
  开发工具:
  文件大小: 16kb
  下载次数: 0
  上传时间: 2008-06-18
  提 供 者: sbi****
 详细说明: 《Java测试题3》

一、 是非题5题(每题3分)
1、 Java是一种计算机语言,更是一种计算机技术。 ( )
2、 Java支持多继承。 ( )
3、 接口是特殊的抽象类。 ( )
4、Java数据库连接用的是ODBC。 ( )
5、封装的原则是用公有的方法访问私有的数据 ( )
二、 填空题(每空2分)
6、Java可以跨平台的原因是( )
7、方法签名(或者特征)是指方法名和( )、( )、( )
8、Java事件处理包括建立事件源、( )和( )
9、JavaBeans的属性分为简单属性、( )、( )、( )。
10、Jsp指令的作用是( )
三、 程序题(每题5分,有单选和多选)
11、下面属于Java 关键字的是
A、 NULL B、IF C、do D、go to
12. 哪一个输出-4.0
A、 System.o ut.println(Math.floor(-4.7));
B、 System.out.println(Math.round(-4.7));
C、 System.out.println(Math.ceil (-4.7));
D、 System.out.println(Math.min(-4.7));
13、下例正确的句子是
A)float 3.14;
B)byte i=225;
C)log k=33;
D)int p[][];

14、给出:
public class foo{
public static void main (String[]args){
String s;
System.out.println(“s=”+s);
}
}
what is the result?
A、The code compiles and “s=” is printed
B 、The code complies and “s=null” is printed
C 、The code does not compile because string s is not initialized
D 、The code does not compile because string s can not be referenced
E 、The code compiles, but a NullPointException is thrown when tostring is called

15、给出:
8.int index=1;
9.int []foo=new int[3];
10.int bar=foo[index];
11.int baz=bar+index;
What is the result?
A、baz has the value of 0
B、baz has the value of 1
C、baz has the value of 2
D、an exception is thrown
E、 the code will not compile

16.下例操作的结果是什么?
System.out prinln(4|3);
1)6
2)0
3)1
4)7

17、哪一个不能被增加到容器?
A、 a Panel
B、 an Applet
C、a Component
D、a top Container
E、a MenuItem

18、给出:
class Test {
int i;
String s;
public void method(){
int i=10;
system.out.println(i);
public Test(){
system.out.println(s);
}
}
What is the result?

19、public class ko3_6{
static{
System.out.println(“Hello”);
}
}

What is the result?
20、public class ko5_8{
public static void main(String args[]) {
int x=1,sum=0;
while(x<=10){
sum+=x;
x++;
}
System.out.println("sum="+sum);
}
}

What is the result?

21、 public class ko6_9
{
public static void main(String args[])
{
int sum=0;
int ko[][]={{1,2,3},{4,5,6},{7,8,9}};
for(int n=0;n<3;n++)
for(int m=0;m<3;m++)
sum+=ko[n][m];
System.out.println("sum="+sum);
}
}

What is the result?

22、public class ko8_1
{
public static void main(String args[])
{
try
{
int x[]=new int[-5];
System.out.println("此行将无法被执行!");
}
catch(NegativeArraySizeException e)
{
System.out.println("exception: " + e.getMessage());
}
}
}

What is the result?
23、 public class ko10_1 extends Thread
{
int n;
ko10_1()
{
Thread td=new Thread(this);
td.start();
}
public void run()
{
for (n=0;n<6;n++)
{
try
{
System.out.print(n);
Thread.sleep(500);
}
catch(InterruptedException e)
{
System.out.println("Exception");
}
}
}
public static void main(String args[])
{
new ko10_1();
}
}
What is the result?


...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: Java试题答案
 输入关键字,在本站1000多万海量源码库中尽情搜索: