Home / C# Programming / Properties :: Discussion

Discussion :: Properties

  1. An Account class has a property called accountNo and acc is a reference to a bank object and we want the C#.NET code snippet given below to work. Which of the following options will ensure this functionality?

    acc.accountNo = 10;  Console.WriteLine(acc.accountNo);

     

     

  2. A.

    Declare accountNo property with both get and set accessors

    B.

    Declare accountNo property with only accessors

    C.

    Declare accountNo property with get ,set and normal accessors.

    D.

    Declare accountNo property with only set accessor.

    E.

    None of these .

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment