学号____________________________姓名_______________________系别____________________
………………………………………………………………………………装…订…线…………………………………………………………………………………
内蒙古师范大学科学史与科技管理系
2005-2006学年第3学期期末考试卷(A)
课程_应用软件设计课程性质_专业限选任课教师( 李慧哲)
本试卷满分( 100 ), 占课程成绩的( 100 )%
一
二
三
四
五
六
总分
评卷人
得分
一、单项选择题(每小题后有四个备选答案,其中只有一个是正确的,请将你认为正确的那个选项前的字母填入其所对应的小题前的括号内。每小题2分,本大题共 30 分)
( ),会有什么结果。
public class Test {
public int x;
public static void main(String args[]){
("Value is " + x);
}
}
A. 输出"Value is 0" .
B. 非静态变量 x 不能被静态方法引用..
C. 产生"illegal array declaration syntax" 编译错.
D. 产生"possible reference before assignment"编译错.
( )2. 编译并运行以下代码时,会有什么结果。
public class Test {
public static void main(String args[]){
int x;
("Value is " + x);
}
}
A. 抛出 ArrayIndexOutOfBoundsException 异常
B. 抛出 NullPointerException 异常
C. 产生"illegal array declaration syntax" 编译错
D. A "possible reference before assignment" compiler error occurs.
( )3. 下面程序产生的结果是
1. public class test {
2. public static void add3 (Integer i) }
3. int val = ( );
4. val += 3;
5. i = new Integer (val);
6. }
7.
8. public static void main (String args [ ] ) {
9. Integer i = new Integer (0);
10. add3 (i);
11. ( ( ) );
12. }
13. )
A. 产生编译错 B. 打印输出“0”.
C. 打印输出“3”. D. 编译成功但在第三行抛出异常
( )4. 下面程序产生的结果是
interface foo {
2. int k = 0;
3. ]
应用软件设计A 来自淘豆网www.taodocs.com转载请标明出处.