Exception Handling on C# related Questions and Answers - Page 3

Question 22 : If the math class had add property with get accessors then which of the following statements will work correctly?
1. math m = new math(); m.add = 10;
2. math m = new math(); m.add = m.add + 20;
3. math m = new math(); int i; i = m.add;
4. math.add = 20;
View Answer   Discuss with Members

Question 23 : If math class had add property with get and set accessors, then which of the following statements will work correctly?
1. math.add = 20;
2.

    math m =  new math();    m.add = 10;

3. Console.WriteLine(math.ad
4. ;d) None of the mentioned
View Answer   Discuss with Members

Question 24 : 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?
1. Declares sum property with only get accessor
2. Declares sum property with only set accessor
3. Declares sum property with both set and get accessor
4. Declares sum property with both set, get and normal accessor
View Answer   Discuss with Members

Question 25 : Consider a class maths and we had a property called as 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?
1. Declare sum property with both get and set accessors
2. Declare sum property with only get accessor
3. Declare sum property with get, set and normal accessors
4. None of the mentioned
View Answer   Discuss with Members

Question 27 : Select the modifiers which can be used with the properties?
1. Private
2. Public
3. Protected Internal
4. All of the mentioned
View Answer   Discuss with Members

Question 28 : Where the properties can be declared?
1. Class
2. Struct
3. Interface
4. All of the mentioned
View Answer   Discuss with Members


View 21 - 30 of 41 Questions

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter