Is there a VB.NET equivalent of C# out parameters?

后端 未结 7 950
野性不改
野性不改 2020-11-30 06:22

Does VB.NET have a direct equivalent to C# out function parameters, where the variable passed into a function does not need to be initialised?

7条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-30 06:51

    You can use the pass by reference method in VB.NET.

    You need the Out parameter mechanism in C#, because it doesn't let you use any variable without initializing it.

    VB.NET doesn't need a special keyword as it automatically does it by itself.

    Just use ByRef.

提交回复
热议问题