第三章C#基础(二)概要.ppt

所有类型和类型成员都具有可访问性级别,用来控制是否可以在您程序集的其他代码中或其他程序集中使用它们。VS2010中修改了protected internal的定义 * * 演示 Notice that ToString is not explicitly used in the program. It is invoked by default by the WriteLine calls. * * * 让学员手写 * 回顾时,可以让学员自己说一个方法的例子,再引入方法定义的形式。 Void, 要么没有return,要么只有不带任何参数的return; * * 参数值传递 * 通过一个值传递无法实现的功能,引出按引用传递参数 * 常见错误:调用时不使用ref,可以给学员看一下错误信息 x=15,y=55 * The main difference between the ref and the out keywords is that, if you pass an argument with out, you must initialize it (give it a value) in the method, whether you will use the argument in the method or not out 关键字会导致参数通过引用来传递。这与 r

文档评论(0)

1亿VIP精品文档

相关文档