C#中的Empty语句示例

using System;

using System.Collections.Generic;

using System.Text;

using System.Reflection;

namespace emptystat

{

    class Empty

    {

        public bool print()

        {

            Console.WriteLine("onitroad");

            return true;

        }

        static void Main(string[] args)

        {

            int i = 0;

            Empty r = new Empty();

            while (r.print())

            {

                ; //Empty Statement

            }

            Console.WriteLine("i = {0}", i);

            Console.ReadLine();

        }

    }

}
C#中的Empty语句

Empty 语句是 C# 中非常简单的语句。 空语句用于需要语句且不需要执行操作的地方。 Empty 语句主要与带有空白主体和标签语句的 while 循环一起使用。

日期:2020-04-11 22:50:27 来源:oir作者:oir