0

Why the code only use "this" keyword instead of "this.names" for indexers property?

class Clients { private string[] names = new string[10]; public string this[int index] { get { return names[index]; } set { names[index] = value; } } }

31st May 2024, 4:44 AM
Edrian Julius Mendoza
Edrian Julius Mendoza - avatar
1 ответ
+ 4
If I'm not mistaken it's because the names are in the get and set as "names[index]"
31st May 2024, 7:13 AM
Ausgrindtube
Ausgrindtube - avatar