开发者

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

开发者 https://www.devze.com 2023-03-28 03:22 出处:网络
Can we define a constructor with \'Friend\' modifier? 开发者_如何学运维Friend Class Reader Friend Sub New()

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消