C# Programming - Properties - Discussion
Discussion Forum : Properties - General Questions (Q.No. 12)
12.
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);
Discussion:
2 comments Page 1 of 1.
Nikki said:
1 decade ago
I am also agree with @Prasanna. If we use both properties any one can change the account number.
Prasanna said:
1 decade ago
Account number will not change for an account holder so it is only get accessor being used not both.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers