网站首页 | J1212大学论坛 | 公务员考试 | CEAC网络工程师 | 软件水平考试 | 专升本考试 | 大学英语4-6级 |计算机等级考试| C/C++编程 | 学习法语 | TOEFL考试资料 | 大学怎么过 | 中英文歌词下载 | 免费资料下载 | 大学知识面 | Linux网络课程 | Java/JSP教程 | 古诗词选录|
公告消息
大学生考试网站

  本站为大学生考试提供全面,及时,准确的服务!还为当代大学生提供学习生活的指点。来源于大学生,服务到大学生中去,是本站的理念!免费是本站的筹码!
栏目分类
 南昌大学计算机系92班级论坛

 ■考试中心
 ◆软件水平考试
 ◆专升本考试
 ◆公务员考试
 ◆CEAC网络工程师
 ◆大学英语四六级
 ◆计算机等级考试
 ◆Toefl考试资料

 大学生频道
 ◆Java/JSP教程
 ◆Linux网络课程
 ◆C/C++编程
 ◆大学怎么过
 ◆大学知识面
 ◆经典英文演讲录音
 ◆招聘信息就业指导
 ◆学习法语
 ◆古诗词选
 下载频道
 ◆电脑软件
 ◆中英文歌词下载
 ◆学习资料
 图库频道
 ◆大学时代相册
 ◆经典图片
 影视频道
 ◆FLASH专区
 ◆站长之家
 ◆站长留言簿
 
 
网站首页 --> Java/JSP编程

J2EE测试31-40题

31Given the following code fragment:
1) String str = null;
2) if ((str != null) && (str.length() > 10)) {
3) System.out.println("more than 10");
4) }
5) else if ((str != null) & (str.length() < 5)) {
6) System.out.println("less than 5");
7) }
8) else { System.out.println("end"); }
Which line will cause error?

A. line 1
B. line 2
C. line 5
D. line 8


32Which statements about Java code security are true?

A. The bytecode verifier loads all classes needed for the execution of a program.
B. Executing code is performed by the runtime interpreter.
C. At runtime the bytecodes are loaded, checked and run in an interpreter.
D. The class loader adds security by separating the namespaces for the classes of the local file system from those imported form network sources.

33Given the following code:
public class Person{
static int arr[] = new int[10];
public static void main(String a[]) {
System.out.println(arr[1];)
}
}
Which statement is correct?

A. When compilation some error will occur.
B. It is correct when compilation but will cause error when running.
C. The output is zero.
D. The output is null.

34Given the following code:
public class Person{
int arr[] = new int[10];
public static void main(String a[]) {
System.out.println(arr[1];)
}
}
Which statement is correct?

A. When compilation some error will occur.
B. It is correct when compilation but will cause error when running.
C. The output is zero.
D. The output is null.

35public class Parent {
public int addValue( int a, int b) {
int s;
s = a+b;
return s;
}
}
class Child extends Parent {

}
Which methods can be added into class Child?

A. int addValue( int a, int b ){// do something...}
B. public void addValue (){// do something...}
C. public int addValue( int a ){// do something...}
D. public int addValue( int a, int b )throws MyException {//do something...}


36A member variable defined in a class can be accessed only by the classes in the same package. Which modifier should be used to obtain the access control?

A. private
B. no modifier
C. public
D. protected

37A public member vairable called MAX_LENGTH which is int type, the value of the variable remains constant value 100. Use a short statement to define the variable.

A. public int MAX_LENGTH=100;
B. final int MAX_LENGTH=100;
C. final public int MAX_LENGTH=100;
D. public final int MAX_LENGTH=100.

38Which expressions are correct to declare an array of 10 String objects?

A. char str[];
B. char str[][];
C. String str[];
D. String str[10];


39Which fragments are correct in Java source file?

A. package testpackage;
public class Test{//do something...}
B. import java.io.*;
package testpackage;
public class Test{// do something...}
C. import java.io.*;
class Person{// do something...}
public class Test{// do something...}
D. import java.io.*;
import java.awt.*;
public class Test{// do something...}

40String t = "hello";
char c[] = {'h','e','l','l','o'} ;
Which return true?

A. s.equals(t);
B. t.equals(c);
C. s==t;
D. t.equals(new String("hello"));
E. t==c.


(c),(bcd),(c),(a),(bc),(b),(d),(c),(acd),(ad)

 


 

   友好链接:

  EditRegion5
首 页 网站介绍 支持论坛 南昌大学计算机系92级班级论坛 联系我们
@j1212.com版权所有,本站所有资料内容和图片文章未经j1212.com或作者本人同意,其他媒体一律不得转载@
Copyright@http://www.j1212.com all rights reserved
Powered by www.j1212.com