One, the field of the class
The field of the class is the data within the class.
Second, the method of the class
1, overloading of functions,
How to judge: is composed of two or more functions of the same name, but the function to have a different parameter, or number. (parameter is the input of the function)
Shuchu () { } Shuchu (int a) { Console.WriteLine (a); } Shuchu (int aaa string bbb) { Console.WriteLine (a+") \ t"+bbb) }
2, Field of class
The common point is that the variables defined within the class are also called member variables.
3, Package
Right-click on the variable inside the class and select encapsulate.
Once encapsulated, the variable becomes a private, semi-variable inside the class.
Can only be changed by the get (read accessor) set (write accessor). cannot be called directly.
4, static members,
You can only operate with the class name, and you cannot use the class's right-of-way error.
Third, the composition of the class correspondence
Class has a default function with the same name as the class. This function becomes the constituent function of the class
1 Public class Class222 2 {3public Class222 ()4 {5 6 }
The difference between a class and an object (personal understanding),
Objects are extended by the class,
There are multiple objects within a class.
The object is the data inside the class.
C # Object-oriented, classes and objects