Understanding class sizes



  • Обьесните, пожалуйста, для чего нужна 16-ая строка...Ведь если уже был инициализирован массив с его тримя элементами...

    Please explain what the 16th line is for. ♪ ♪ I mean, if there's already been an initialization of its three elements, why do you have to do it again? ♪ ♪



  • Because when you do that

    Mix4[] m4a = new Mix4[3]
    

    You only create a set of objects. If you see what's in this body, you'll see that there are three objects that refer to. null

    In order to fill the mass, it's exactly 16 lines from your code.

    The 12 row initiates the mass, 16 row initiates the elements of the mass.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2