为什么我这个输出的是:我今年1岁了和我今年2岁了?
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Youeryuan
{
class Program
{
static void Main(string[] args)
{
Child c1 = new Child("晓强", 3);
Growth(c1);
Growth(c1.Age);
Console.ReadLine();
}
static void Growth(Child chlid)
{
chlid.Age++;
Console.WriteLine("我今年"+chlid.Age+"岁了1!");
// Console.WriteLine("我又长大了一岁!");
}
static void Growth (int age)
{
age++;
Console.WriteLine("我今年{0}岁了2!", age);
}
}
}