1
splitStrings去掉了空格就是没有空隙的一行。
2
3
enum{}不能写在类里;
namespace{}
class{}
Main(){}
4
错误 CS1656 无法为“item”赋值,因为它是“foreach 迭代变量”
5
和c int* arrayHere =new int [6];区别不大
6
class:消息:必须大写才合适?
7枚举&位运算
&验证
|添加
^删去
7
异常:很严峻呀
8
应当是把这个放到【GreetingManager】类里。如果偏不,就是出现这个错误
GreetingDelegate delegate1;
9【不重要】
可以当做“标准”
10
记录下。事件只能放到类里搞,类外出错;所以要定义【GreetPeople】函数,让类外调用。
11
解读: 事件 +=类.委托(类.静态函数);
12
13
这种finally也是没输出的。
using System;
class MyApp
{
static int f(int i)
{
return 100 / i;
}
public static void Main()
{
try
{
int dZero = f(0);
}
finally
{
Console.WriteLine("finally");
}
}
}
?
5还没“四舍五入”进上去。呃呃呃
。。。
namespace ConsoleApplication1
{
[Flags]
enum Days2
{
None = 0x0,
Sunday = 0x1,
Monday = 0x2,
Tuesday = 0x4,
Wednesday = 0x8,
Thursday = 0x10,
Friday = 0x20,
Saturday = 0x40
}
class MyApp
{
static void Main()
{
Days2 meetingDays = Days2.Tuesday | Days2.Thursday;
Console.WriteLine(meetingDays.ToString());
bool test = (meetingDays & Days2.Thursday) == Days2.Thursday;
Console.WriteLine("Thursday {0} a meeting day.", test == true ? "is" : "is not");
meetingDays = meetingDays ^ Days2.Tuesday;
Console.WriteLine(meetingDays);
}
}
}