0
Why is this returning an error
2 ответов
+ 3
Line 13,
`private string[] names = new string[1];`
Here, you have set the maximum capacity of the array to 1. But on line 30,
`u[1] = "oritseweyinmi";`
you are setting the one-th index, which does not exists as the maximum capacity is 1.
Set the maximum capacity of the array to 2 (or more according to your needs), and it will work. You can also take a size in the constructor of the class, and set length of the array to that.
0
Thanks