S2阶段考试[含答案] 联系客服

发布时间 : 星期二 文章S2阶段考试[含答案]更新完毕开始阅读9af7b0524a7302768e99395a

<%=strTime

;

%>(选择一项)

A)2013年04月15日 B)2013年05月15日 C)13年4月15日 D)编译错误

37)在JavaScript中,对字符串str=”Hello World”的操作结果正确的是(D)(选择一项) A)str.substring(1,7)返回值是“ello Wo” B)str.length()返回值为11

C)str.index(“llo”)返回值为3 D)str.charAt(1)的返回值为“e”

38)阅读下了Java代码,说法正确的是(d)。 import java.util.*; public class TestList{ public static void main(String[]args){ List list=new ArrayList(); List.add(“A”); List.add(“B”); List.add(“C”); List.remove(2); //1行

Iterator it=list.iterator(); //2行 While(it.hasNext()){ //3行

String str=it.next(); //4行

it.next此时返回为object

System.out.println(str); }

}

}(选择一项)

A)第一行代码有问题 B)第二行代码有问题 C)第三行代码有问题 D)第四行代码有问题

39)在C#中,关于TreeView一下说法错误的是(c)。(选择一项) A)TreeNode是TreeView的节点的类型

B)通过Add()方法可以给TreeView添加节点,Remove()方法可以移除指定节点

C) TreeView可以在设计界面和XML文件直接绑定 D) TreeView的SelectedNode属性表示当前选中的节点

40)在C#中,运行一下代码,则说法正确的是(c)。 Public class Student{ Public string name;

Public Student(string name){ This.name=name;

} }

Calss Program{

Static void Main(string[] args) { Student stu=new Student(); Stu.name=”李四”; Console.WriteLine(stu.name); }

A 正确执行,输出“李四” B 正确执行,什么也不输出

C编译错误,提示“student类不包含0个参数的构造函数” D编译错误,提示“未将对象引用设置到对象实例”

注意:实例化类时必需匹配调用构造函数

41 )以下C#代码的输出结果为(c) Public class Stdent {

Public int id; }

Public class Program { Static void Alter(Student stu)

{ Stu.id++; Console.WriteLine(“id={0}”,stu.id); } Static void Main()

{

Student stu=new Student(); Stu.id=1; Alter(stu);

Console.WriteLine(“id={0}”stu.id); }

} (选择一项) A id=1 Id=1 B id=1 Id=2 C id=2 Id=2 D id=2

Id=1

42 在SQL Server 中,以下能够正确输出结果的语句是(c)。A select 学号,成绩,等级= case 成绩 when<100 then’A’ when<80 then’B’ when<60 then’C’ else ‘成绩输入有误!’ end from students go

B select 学号,成绩,等级= case when 成绩<100 then’A’ when成绩<80 then’B’ when成绩<60 then’C’ else ‘成绩输入有误!’ end

from students go

C select 学号,成绩,等级= case

when 成绩<60 then ‘C’ when成绩<80 then ’B’ when成绩<100 then ’A’ else ‘成绩输入有误!’ end

from students go

D select 学号,成绩,等级=

case

(选择一项) when 成绩<100 then’A’ when成绩<80 then’B’ when成绩<60 then’C’ else ‘成绩输入有误!’ end case from students go

43 阅读下列java 代码,说法不正确的是(c) Import java。Id.*; Public class TestIO{ Public static void main(String[] args){ Reader fr=null; Try{ Fr=new FileReader(“c:\\\\mytext.txt”); Char ch[]=new char(1024); Int length=fr.read(ch); While(length!=-1){ Length=fr.read(ch);

}

}catch(_________1________e){ e.printStackTrace();

}catch(________2________e){

e.printStackTrace(); }finally{

//此处省略关闭流

} }

}(选择一项)

a) 第1处应该填入FileNotFoundException b) 第2处应该填入IOException c) 第1处属于运行时异常

d) 第2处应该属于Checked异常

44)运行以下c#代码,则说法正确的选项是( a ). Public abstract class Person {

Public abstract void Study(String course); }

Public class Student:Person {

Public override void Study(String course)

{

Console.WriteLine(“学习”+course); }