C# Programming :: Properties
-
If Sample class has a Length property with get accessor then which of the following statements will work correctly?
-
An Account class has a property called accountNo and acc is a reference to a bank object and we want the C#.NET code snippet given below to work. Which of the following options will ensure this functionality?
acc.accountNo = 10; Console.WriteLine(acc.accountNo);
-
Which of the following statements is correct about properties used in C#.NET?
-
Which of the following is the correct way to implement a read only property Length in a Sample class?
-
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?
A.
|
B.
|
C.
|
D.
|