1. The out field must be assigned a value to the method, and the out keyword must be added before the variable to focus on the output.
2. When calling the ref modifier, you must add the ref keyword before the variable. You can modify the value or not to modify it.
3. The out and ref parameters can only pass variables, but cannot pass constants. Instead of passing the value of a variable, the address of the variable is passed.
3. The out value can be left unspecified before being passed, because the out value will definitely be assigned in the method, and the ref must have a value before being passed, because the parameter values may be used in the method.
TestOut (=; TestRef (+ =; Main (I = [] arr = {, min = max, ++ GetMaxAndMin ([] arr, max, (I =; I <arr. length-; I ++ (j =; j <arr. length -- I; j ++ (arr [j]> arr [j + temp = arr [j ++] = arr [arr. length-= arr [View Code
Figure (understanding that out and ref are just the address passed, not the value ):