摘要: class MainClass { public static void Main(string[] args) { int[] hehe=new int[5]{12,6,5,8,9}; Console.WriteLine("array before sorted is as following"); display(hehe); Array.Sort(hehe... 阅读全文
posted @ 2008-06-02 11:23 LMT 阅读(163) 评论(0) 推荐(0)
摘要: 构造函数 如果一个类不包含构造函数,那么编译器将创建一个名为“默认构造函数”的隐含方法,默认构造函数包含一个空白的参数列表。 使用构造函数的注意事项 类的构造函数名要与类名相同 构造函数没有返回类型 一般情况下,构造函数是public类型的 不能显式调用构造函数 析构函数 ~类名(){statement} 析构函数的注意事项 析构函数没有参数 析构函数没有返回值... 阅读全文
posted @ 2008-06-02 10:17 LMT 阅读(169) 评论(0) 推荐(0)