云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > S2阶段考试[含答案]

S2阶段考试[含答案]

  • 62 次阅读
  • 3 次下载
  • 2025/5/24 9:11:10

<%=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); }

搜索更多关于: S2阶段考试[含答案] 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

<%=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 Ar

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com