添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
爱搭讪的烤红薯  ·  国家地理·  6 月前    · 
失恋的滑板  ·  Command handling | ...·  6 月前    · 
爽快的手链  ·  小雪节气的由来 _ ...·  1 年前    · 
博学的海龟  ·  Welcome to Discuss ...·  1 年前    · 
热心肠的红烧肉  ·  特性·  1 年前    · 

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

In this article

You use void as the return type of a method (or a local function ) to specify that the method doesn't return a value.

public static void Display(IEnumerable<int> numbers)
    if (numbers is null)
        return;
    Console.WriteLine(string.Join(" ", numbers));

You can also use void as a referent type to declare a pointer to an unknown type. For more information, see Pointer types.

You cannot use void as the type of a variable.

See also

  • System.Void
  • Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see: https://aka.ms/ContentUserFeedback.

    Submit and view feedback for

    This product