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);

- Online Exam Test Papers | - MCQs[multiple choice questions and answers ] | - Mock Test Papers | - Practice Papers | - Sample Test Papers |

Question:
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);

1.m.Length = 10;

2.Declare accountNo property with only get accessor.

3.Declare accountNo property with get, set and normal accessors.

4. Declare accountNo property with only set accessor.

Posted Date:-2021-02-25 10:06:08


More MCQS Questions and answers

Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!