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

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

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

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

J2EE测试41-50题

41Which of the following statements are legal?

A. long l = 4990;
B. int i = 4L;
C. float f = 1.1;
D. double d = 34.4;
E. double t = 0.9F.

42public class parent {
int change() {}
}
class Child extends Parent {

}
Which methods can be added into class Child?

A. public int change(){}
B. int chang(int i){}
C. private int change(){}
D. abstract int chang(){}

43class Parent {
String one, two;
public Parent(String a, String b){
one = a;
two = b;
}
public void print(){ System.out.println(one); }
}
public class Child extends Parent {
public Child(String a, String b){
super(a,b);
}
public void print(){
System.out.println(one + " to " + two);
}
public static void main(String arg[]){
Parent p = new Parent("south", "north");
Parent t = new Child("east", "west");
p.print();
t.print();
}
}
Which of the following is correct?

A. Cause error during compilation.
B. south
east
C. south to north
east to west
D. south to north
east
E. south
east to west

44A Button is positioned in a Frame. Only height of the Button is affected by the Frame while the width is not. Which layout manager should be used?

A. FlowLayout
B. CardLayout
C. North and South of BorderLayout
D. East and West of BorderLayout
E. GridLayout

45Given the following code:
1) class Parent {
2) private String name;
3) public Parent(){}
4) }
5) public class Child extends Parent {
6) private String department;
7) public Child() {}
8) public String getValue(){ return name; }
9) public static void main(String arg[]) {
10) Parent p = new Parent();
11) }
12) }
Which line will cause error?

A. line 3
B. line 6
C. line 7
D. line 8
E. line 10

46The variable "result" is boolean. Which expressions are legal?

A. result = true;
B. if ( result ) { // do something... }
C. if ( result!= 0 ) { // so something... }
D. result = 1

47Class Teacher and Student are subclass of class Person.
Person p;
Teacher t;
Student s;
p, t and s are all non-null.
if(t instanceof Person) { s = (Student)t; }
What is the result of this sentence?

A. It will construct a Student object.
B. The expression is legal.
C. It is illegal at compilation.
D. It is legal at compilation but possible illegal at runtime.

48Given the following class:
public class Sample{
long length;
public Sample(long l){ length = l; }
public static void main(String arg[]){
Sample s1, s2, s3;
s1 = new Sample(21L);
s2 = new Sample(21L);
s3 = s2;
long m = 21L;
}
}
Which expression returns true?

A. s1 == s2;
B. s2 == s3;
C. m == s1;
D. s1.equals(m).

49Given the following expression about List.
List l = new List(6,true);
Which statements are ture?

A. The visible rows of the list is 6 unless otherwise constrained.
B. The maximum number of characters in a line will be 6.
C. The list allows users to make multiple selections
D. The list can be selected only one item.


50Given the following code:
class Person {
String name,department;
public void printValue(){
System.out.println("name is "+name);
System.out.println("department is "+department);
}
}
public class Teacher extends Person {
int salary;
public void printValue(){
// doing the same as in the parent method printValue()
// including print the value of name and department.
System.out.println("salary is "+salary);
}
}
Which expression can be added at the "doing the same as..." part of the method printValue()?

A. printValue();
B. this.printValue();
C. person.printValue();
D. super.printValue().

(ade),(ab),(e),(d),(d),(ab),(c),(b),(ac),(d)

 


 

   友好链接:

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