没有ref的方法时: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication7 { class Program { static void Main(string[] args) { ; Test(number); Console.WriteLine(number)
类定义 package Reflect; public class MyTest { public int a; public static int b; public static final int c = 0; private int d; public int sum(int a, int b) { return a + b; } public int sub(int a, int b, String c) { System.out.println(c); return a - b;
案例1: static void Main() { , , , }; int numLargerThan10,numLargerThan100,numLargerThan1000 ; Proc(ary, out numLargerThan10, out numLargerThan100, out numLargerThan1000); Console.WriteLine("有{0}个数大于10,有{1}个数大于100,有{2}个数大于1000",numLargerThan10,numL