更新时间:2023-02-08 09:29:32
没有,C#不具备在这种情况下,相同的语义的Java。你可以让 TestVariable
常量
,静态
,或通外
的实例内蒙古构造
因为你已经注意到。
No, C# does not have the same semantics as Java in this case. You can either make TestVariable
const
, static
, or pass an instance of Outer
to the constructor of Inner
as you already noted.