Discussion Forum

  1. Home
  2. »
  3. Languages
  4. »
  5. An Account class has a...
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); 

Declare accountNo property with both get and set accessors.

Declare accountNo property with only get accessor.

Declare accountNo property with get, set and normal accessors.

Declare accountNo property with only set accessor.

Answer: A . Declare accountNo property with both get and set accessors.
0Shares
0 0

If you think the posted answer is wrong or Confused About the Answer? Ask for Details Here

Know Explanation? Add it Here
we’ll review your comment and contact you soon….

Leave a Reply

Your email address will not be published. Required fields are marked *

0Shares
0
Scroll to Top