1.类(class)是存在堆(heap)上的引用类型,而结构(struct)是存在堆栈(stack)上的值类型。
2.不能像C++一样将类的方法的声明和实现分隔开来。
3.传递给方法的参数都必须先初始化。当遇到out关键字时例外(见5)。
4.ref参数,迫使值参数通过引用传送给方法。如void fun(ref int i)。调用时fun(ref i)。
5.out关键字,当使用out关键字时,传递给该方法的变量可以不被初始值初始化。
6.方法重载注意事项:①不支持默认参数;②返回类型不做参考;③不能仅根据参数是声明为ref还是out来区分。
7.属性访问器(accessor):get{return …};set{ value = …}; 只读属性省略set,只写属性省略get。
8.类的字段默认情况下初始化为0。
9.如果提供了带参数的构造函数,编译器就不会提供默认的构造函数。
10.如果把构造函数定义为private或protected,该类就不能通过new在外部代码中实例化。
11.静态构造函数:static MyClass(){}。.NET运行库没有确保静态构造函数在什么时候执行,但确保至多执行一次,并且在代码引用类之前执行;只能访问类的静态成员。
12.构造函数初始化器(constructor initializer):如public Car(string model):this(model,4){…},这里假设Car类还有一个构造函数public Car(string model, int wheels){…}。还可以使用base关键字代替this来对直接基类的构造函数进行调用。
13.只读字段:通过readonly关键字实现,只能在构造函数中给只读字段赋值,不能在其他地方赋值。只读字段可以是实例字段,而const字段必定是静态(static)字段。
14.结构(struct)不支持实现继承;结构有默认构造函数,该函数不允许替代。
Administrator i.t.
I am really pissed off at the internet infrastructure here. A few days ago, a technical forum hosted in Hong Kong was blocked. Now, websites that have not put on records yet will not easy to hosted in mainland. So, what’s gonna be? Internet will be under surveillance just like traditional media. Oops!
I have no confidence with those local hosting services, and I hate to be recorded. Until now, all my domains, e-mail services and hosting services have transferred to some oversea companies.
When can we enjoy the freedom of Internet?
Administrator essays
Just wanna have some practice of my written English skills.
Administrator essays
Web 2.0 is really hot these days. I don’t know who invent this term. A lot of new terms came out and I didn’t even know, such as trackback, tags, technorati, flickr and so on. When I google something, more and more blogs are shown as results. Maybe its time to get a blog now.
It is not easy to pick a stable and suitable blog system. So, I google it. It seems wordpress is the most popular one. Ok, let’s do it.
First thing is to find a place to host the blog. One of my friend have a dedicated server, which I could count on it. However, the server has no php, no mysql, and has been crushed for 2 days, oops. I need web hosting service. Obviously, Dreamhost has good recommendations among bloggers. And the most important thing is cheap! It only takes me $24.40(annually), and I get 4.8GB disk storage, 120GB monthly Bandwidth, Unlimited MySql, and a domain name.
Installation of WordPress is a piece of cake. But it is complex to manage it well, as there are a huge amount of plugins. Here is some useful plugins, I may have some of them installed later.
1。Brian’s Latest Comments
2。Event Calendar
3。Jerome’s Keywords
4。WP-OnlineCounter
5。wp-pager
6。WYSI-Wordpress
7。Sideblog
8。KG Archives
9。……
Technorati : plugins, wordpress
Administrator essays
Recent Comments