下载此文档

C#中static类型的变量和方法.doc


文档分类:IT计算机 | 页数:约8页 举报非法文档有奖
1/8
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/8 下载此文档
文档列表 文档介绍
C#中static类型的变量和方法
Variables and methods of type C# in static
define variables and methods, and do not know when to add and the concept of object, it is only the class itself of this concept, and it is the object belongs to the two mutual demolition of the state, that is I without you, without you in my situation. That is, you use object names, static variables, or object names. Static methods are not accessible.
each class must have a constructor, otherwise this class cannot be instantiated into an object. And we sometimes define classes that do not write their constructors, because the compiler adds a static null constructor to us. This can be instantiated. Static constructors can also be used to initialize static variables.
The full use of static
To understand static, you must first understand one another and the relative words, many people may not know the key, that is auto, in fact, we do not usually statement static modified variable is auto, because it is the default, like short and long int as the default is always we usually declare a variable:
Int a;
String s:
In fact:
Auto int a;
Auto string s:
And the declaration of the static variable is:
Static int a;
Static string s:
This seems to be more conducive to understanding that auto and static are a pair of keywords, like private, protected, and public;
To understand static, in fact is to don't understand a

C#中static类型的变量和方法 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数8
  • 收藏数0 收藏
  • 顶次数0
  • 上传人蓝天
  • 文件大小84 KB
  • 时间2022-05-20