当前位置: 动力学知识库 > 问答 > 编程问答 >

Can we define a constructor in Vb.Net with a 'Friend' modifier?

问题描述:

Can we define a constructor with 'Friend' modifier?

 Friend Class Reader

Friend Sub New()

End Sub

End Class

Thanks!

网友答案:

Yes, no problem. It is superfluous since the Friend accessor on the class already puts the constructor out of reach. The VB.NET compiler doesn't mind though, nor does the C# compiler for that matter. There is no inconsistency.

分享给朋友:
您可能感兴趣的文章:
随机阅读: