locked
Understanding a variable instantiation RRS feed

  • Question

  • User2028313481 posted

    Can someone explain to me what this variable instantiation is doing?

         Dim myVar As MyExample.Stuff()() = New MyExample.Stuff(0)() {}

     I dont understand the ()() or the (0)() {}

    Thanks,

    Monday, April 14, 2008 5:45 PM

Answers

  • User735268165 posted

    Hi, It seems like a custom class being instantiated with an array of the same object type initialized with a new array of the type with size 1, in other words it will initially contain an array with only one instance of the class in the first array position. see the constructor of the Stuff class for more information on what is happening with the Stuff class is initialized.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 14, 2008 6:52 PM