摘要: public string Test { get{return _test;} set{_test = value;} } 其实和直接声明public差不多的,但是我们以后编程的时候, 例如年龄有个什么限制的话,这个就很有用了,例如: private int _age; public int age { get { return _age; } set { if (... 阅读全文
posted @ 2008-09-05 16:57 kin2321 阅读(2099) 评论(2) 推荐(1) 编辑
摘要: 呵呵,又有收获 计算1!+...10!的值 第一要阶乘,第二要累加 int i=1; int b=1; int c=0; while (i <= 10) { b = b * i; c = b + c; ... 阅读全文
posted @ 2008-09-05 15:51 kin2321 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 创造了一个类,对象化,然后调用 方法必须有一个返回值(int,string)或Void 如 public int firstMethod() using System; using System.Collections.Generic; using System.Text; namespace test5 { class Example { static voi... 阅读全文
posted @ 2008-09-05 14:18 kin2321 阅读(116) 评论(0) 推荐(0) 编辑