Consider A Class Maths And We Had A Property Called As Sumb #470
Consider a class maths and we had a property called as sum.b which is the reference to a maths object and we want the statement Console.WriteLine(b.sum)to fail. Which among 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 as sum.b which is the reference to a maths object and we want the statement Console.WriteLine(b.sum)to fail. Which among the following is the correct solution to ensure this functionality?
Declares sum property with only get accessor
Declares sum property with only set accessor
Declares sum property with both set and get accessor
Declares sum property with both set, get and normal accessor