public void Out(out int a, out int b)
{//out相当于return返回值
//可以返回多个值
//拿过来变量名的时候,里面默认为空值
a=1;
b=2;
}
static void Main(string[] args)
{
int a = 0;
int b = 1;
Program hanshu = new Program();
hanshu.Out(out a, out b);
时间: 2024-11-06 21:21:31