Home » C# Programming » Properties

A Student class has a property called rollNo and stu is a reference to a Student object and we want the statement stu.RollNo = 28 to fail. Which of the following options will ensure this functionality?

Correct Answer: Declare rollNo property with only get accessor.

← Previous Question Next Question→

More Questions from Properties

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion