Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Properties
Which of the following statements is correct about properties used in C#.NET?
A property can simultaneously be read only or write only.
A property can be either read only or write only.
A write only property will have only get accessor.
A write only property will always return a value.
Correct Answer:
A property can be either read only or write only.
← Previous Question
Next Question→
More Questions from
Properties
If Sample class has a Length property with get accessor then which of the following statements will work correctly?
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?
If Sample class has a Length property with get and set accessors then which of the following statements will work correctly? Sample.Length = 20; Sample m = new Sample(); m.Length = 10; Console.WriteLine(Sample.Length); Sample m = new Sample(); int len; len = m.Length; Sample m = new Sample(); m.Length = m.Length + 20;
A property can be declared inside a class, struct, Interface.
Which of the following statements is correct about properties used in C#.NET?
A property can be declared inside a namespace or a procedure.
Suppose a Student class has an indexed property. This property is used to set or retrieve values to/from an array of 5 integers called scores[]. We want the property to report "Invalid Index" message if the user attempts to exceed the bounds of the array. Which of the following is the correct way to implement this property?
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments