Consider A Class Maths And We Had A Property Called A Sumb Is A #469
Consider a class maths and we had a property called a sum.b is a reference to a maths object and we want the statement b.sum = 10 to fail. Which of the following is the correct solution to ensure this functionality?
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Indexers and Exception Handling - Introduction of Properties - Quiz No.1.
Consider a class maths and we had a property called a sum.b is a reference to a maths object and we want the statement b.sum = 10 to fail. Which of the following is the correct solution to ensure this functionality?
Declare sum property with both get and set accessors
Declare sum property with only get accessor
Declare sum property with get, set and normal accessors
None of the mentioned