C # study notes (1) by Heiyeluren
Learn the personal notes of "Visual C # entry classics".
1. The overload function overload of the function provides the ability to create multiple symbols. We determine that a function is a unique method to pass three methods, which are the type, function name, function of the return value, respectively.
Three items such as parameters. Our function overload is mainly to use different parameters to determine the use of that function.
For example, our code: class class1 {static int maxvalue (int = IntArray) {int maxval = INTARRAY [0]; for (INT i = 1; I
Static void main (string [] args) {int [] MyArray = {1, 8, 3, 6, 2, 5, 9, 3, 0, 2}; int maxval = maxValue; console.writeline The maximum value in myarray is {0} ", maxval);}}
The above function MaxValue () can only process an INT type array, so we now need it to deal with different types of arrays, such as floating point. Then we can add the following code:
Static Double MaxValue (Double) {Double Maxval = DoubleArray [0]; for (INT i = 1; i
Then we can handle the INT and Double types of different arrays, we mainly determine the use of that function by submitting different parameter types.
2. Entrusted to be honest, I didn't have agriculture to understand the concept of entrustment, it is said to be because C # has no pointer, using this thing to make up for it, so this problem will be left. . . :-)
WRITETIME: 2004-12-29 15:47 pm