gpt4 book ai didi

c# - Protected Internal 和 Internal Protected 之间有区别吗?

转载 作者:太空狗 更新时间:2023-10-29 21:09:33 27 4
gpt4 key购买 nike

public class TestClass
{
protected internal int FieldA;
internal protected int FieldB;
}

protected 内部成员和内部 protected 成员之间有区别吗?

最佳答案

Is there a difference between protected internal and internal protected members?

它们之间没有区别。

protected internal 表示protectedinternal

internal protected 表示internalprotected

The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly. Access from another assembly must take place within a class declaration that derives from the class in which the protected internal element is declared, and it must take place through an instance of the derived class type.

在这两者中,protected internal 是常用的。 MSDN page about Access Modifiers 上没有对 internal protected 的引用.

另请查看 Phil Haack 的博客文章 What Does Protected Internal Mean?

关于c# - Protected Internal 和 Internal Protected 之间有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14927545/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com