Original link: https://chenyan98.cn/3643.html
1. About variables [1] Variable types: Local variables (variables used inside a method can only be used by the method itself) (destructed when the method is executed) Member variables (defined outside the method and inside the class, you can Used by other methods inside the class) Destroy global variables (usually public static modification) with the destruction of the object. That is to say, any other class can use “Class Name. Global Variable Name” [2] Attention to the use of variables: When a variable is used, it cannot go beyond the scope of action, and it must be assigned first, because the variable we use requires a clear value. In strings: a = “” and b = string.Empty are the same, but they are not the same as string b=null;. string a; string b=null; if we define […]
This article is reproduced from: https://chenyan98.cn/3643.html
This site is for inclusion only, and the copyright belongs to the original author.