C# Programming - Properties
Exercise : Properties - General Questions
- Properties - General Questions
Which of the folowing does an indexer allow to index in the same way as an array?
- A class
- A property
- A struct
- A function
- An interface
An Employee class has a property called age and emp is reference to a Employee object and we want the statement Console.WriteLine(emp.age) to fail. Which of the following options will ensure this functionality?