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

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

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

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

J2EE测试21-30题

21Which of the following assignment is not correct?

A. float f = 11.1;
B. double d = 5.3E12;
C. double d = 3.14159;
D. double d = 3.14D.


22Given the uncompleted code of a class:
class Person {
String name, department;
int age;
public Person(String n){ name = n; }
public Person(String n, int a){ name = n; age = a; }
public Person(String n, String d, int a) {
// doing the same as two arguments version of constructor
// including assignment name=n,age=a
department = d;
}
}
Which expression can be added at the "doing the same as..." part of the constructor?

A. Person(n,a);
B. this(Person(n,a));
C. this(n,a);
D. this(name,age).

23Which of the following statements about variables and their scopes are true?

A. Instance variables are member variables of a class.
B. Instance variables are declared with the static keyword.
C. Local variables defined inside a method are created when the method is executed.
D. Local variables must be initialized before they are used.

24public 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");
}
}
Which will display if oneMethod run normally?

A. condition 1
B. condition 2
C. condition 3
D. finally

25Given the following code:
public class Test {
void printValue(int m){
do { System.out.println("The value is"+m);
}
while( --m > 10 )
}
public static void main(String arg[]) {
int i=10;
Test t= new Test();
t.printValue(i);
}
}
Which will be output?

A. The value is 8
B. The value is 9
C. The value is 10
D. The value is 11

26Which of the following statements about declaration are true?

A. Declaration of primitive types such as boolean, byte and so on does not allocate memory space for the variable.
B. Declaration of primitive types such as boolean, byte and so on allocates memory space for the variable.
C. Declaration of nonprimitive types such as String, Vector and so on does not allocate memory space for the object.
D. Declaration of nonprimitive types such as String, Vector ans so on allocates memory space for the object.


27In the Java API documentation which sections are included in a class document?

A. The description of the class and its purpose
B. A list of methods in its super class
C. A list of member variable
D. The class hierarchy

28Given the following code:
1) public void modify() {
2) int i, j, k;
3) i = 100;
4) while ( i > 0 ) {
5) j = i * 2;
6) System.out.println (" The value of j is " + j );
7) k = k + 1;
8) i--;
9) }
10) }
Which line might cause an error during compilation?

A. line 4
B. line 6
C. line 7
D. line 8

29Which of the following statements about variables and scope are true?

A. Local variables defined inside a method are destroyed when the method is exited.
B. Local variables are also called automatic variables.
C. Variables defined outside a method are created when the object is constructed.
D. A method parameter variable continues to exist for as long as the object is needed in which the method is defined.


30A class design requires that a member variable cannot be accessible directly outside the class. Which modifier should be used to obtain the access control?

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


答案依次为:
(a),(c),(acd),(ad),(c),(cd),(acd),(c),(abc),(d)

 


 

   友好链接:

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