namespace 函数参数默认值
{
    class Program
    {   
        public static void Test(int i =100)
        {
            Console.WriteLine("{0}",i);
        }
        static void Main(string[] args)
        {
            Test();
            Test(222);
            Console.Read();
        }
    }
}

输出:100

   222

相关文章:

  • 2022-12-23
  • 2021-07-27
  • 2022-12-23
  • 2021-11-29
  • 2022-01-22
  • 2021-10-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-14
  • 2021-11-29
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案