ref和out的使用与区别
摘要:
out的使用————————————————————————————————————————————————— class Program { static void Main(string[] args) { string tmp; //先声明,但不初始化 User _user=new User(); _user.Name(out tmp); //调用Name方法 Console.WriteLine("{0}",tmp); //这时tmp的值为“在这里面赋值了” Console.ReadKey(true); }} class User { publicvo 阅读全文
posted @ 2010-12-31 11:48 JRoger 阅读(25962) 评论(2) 推荐(4)