你的位置: 码友网首页 / 资讯源列表 / C# 8 Interfaces: Static Members

关于[C# 8 Interfaces: Static Members]的摘要:

When taking a closer look at C# 8 interfaces, we have a new capability: interfaces can have static members (including static fields). Static members give us the ability to run code from an interface without an instance of that interface. This functionality is similar to how static members work in classes. Let's take a look at an example to show what we can and can't do with static interface members. The code for this article is available on GitHub: jeremybytes/interfaces-in-csharp-8. Note: this article uses C# 8 features which are not available in .NET Framework 4.8. For these samples, I used Visual Studio 16.4.1 and .NET Core 3.1.100.

原文地址: https://jeremybytes.blogspot.com/2019/12/c-8-interfaces-static-members.html

收录时间: 2019-12-17 浏览量: 1907 分类: C#开发

| 0 收藏 | 0