正在加载图片...
12.1定义字段 ■用变量声明格式和修饰符来定义字段。 class myclass pub l ic int My Int 可以使用关键字 readonly,表示字段只能在执行构造函 数的过程中赋值,或由初始化赋值语句赋值 class myclass pub l ic readonly int My lnt=171.2.1 定义字段  用变量声明格式和修饰符来定义字段。 class MyClass { public int MyInt; }  可以使用关键字readonly,表示字段只能在执行构造函 数的过程中赋值,或由初始化赋值语句赋值。 class MyClass { public readonly int MyInt=17; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有