没有合适的资源?快使用搜索试试~ 我知道了~
C# Lab Arrays and Collections
需积分: 0 0 下载量 173 浏览量
2012-12-28
12:30:52
上传
评论
收藏 93KB DOC 举报
温馨提示
试读
12页
C# Lab Arrays and Collections
资源详情
资源评论
资源推荐
C# Lab: Arrays and Collections
60 minutes
Objectives
!"
#
!#
$#
Before You Begin
Prerequisites
$ % &' ($
)&*+
Exercises
,$-$
.
Exercise 1: Simple Arrays
/,
Exercise 2: Multidimensional Arrays
/,"
Exercise 3: Arrays and Collection Classes
/ , #
.!#
Exercise 4: A user-de+ned collection
/,0,
foreach
C# Lab: Arrays and Collections
Exercise 1: Simple Arrays
,1#2
/$'. System.Array.
12"
.$1#2
$/int"3
,
4 /%&'.5'6"&6"
7 84812
1"02
// file1.cs
using System;
public class Test
{
public static void Main()
{
int[] arr = new int[2];
arr[0] = 1;
arr[1] = 3;
for (int index = 0; index < arr.Length; index++)
Console.WriteLine("Value is {0}", arr[index]);
}
}
9 6 .4:
,%&$
$ ; % & $ $
.4: 6 .<
,
arr
,:4/=:>
102= #4>12
$$
Length1System.Array2
"
/
$arr
int[] arr = new int[2] {1, 3};
int[] arr = {1, 3};
,
4 / " 1 2
812
7
C# Lab: Arrays and Collections
//file2.cs
using System;
class Test
{
static public void Main()
{
string[] arr = { "The", "Quick", "Brown", "Fox"};
foreach (string s in arr)
Console.WriteLine("Value is {0}", s);
}
}
76.<
, foreach
$
$$ '. $#0
? " )
4/"12
812
// file3.cs
using System;
class Test
{
static public void Main()
{
string sentence = "When in the course of human events";
char[] separators = new char[1] {' '};
foreach (string s in sentence.Split(separators))
Console.WriteLine("Value is {0}", s);
}
}
76.<1.4:2
$
/,Split()string
Split()
$foreach
;$
@
,
4/"12
812
// file4.cs
using System;
class Test
{
static public void Main()
{
string[] test = new string[5];
Console.WriteLine(test[3] == null);
}
}
76.<1.4:2
9
剩余11页未读,继续阅读
yanhung
- 粉丝: 7
- 资源: 126
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 前端开发-什么是前端开发-关于前端开发的一些相关介绍
- Sora AI-关于文生视频的使用场景说明
- suno AI文生视频的相关教程和介绍使用
- 什么是后端开发-关于后端开发的一些小介绍分享
- Jurassic Pack Vol. II Dinosaurs 侏罗纪包卷恐龙二号Unity游戏模型资源unitypackage
- Jurassic Pack Vol. III Dinosaurs 侏罗纪包卷恐龙三号Unity游戏模型资源unitypackag
- Ultimate Seating Controller 终极座椅控制器Unity游戏开发插件资源unitypackage
- 什么是人工智能-关于人工智能的相关介绍说明
- Figma Converter for Unity适用Unity的Figma转换器Unity游戏开发插件unitypackage
- Creepy Animatronic Anims 令人毛骨悚然的电子动画Unity游戏动画插件资源unitypackage
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0