-1

Can we define a constructor with 'Friend' modifier?

     Friend Class Reader

       Friend Sub New()
       End Sub

     End Class

Thanks!

Jyina
  • 2,530
  • 9
  • 42
  • 80

1 Answers1

2

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.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536