Question:Which of the following are correct ways to define CurrentPrice property in the class Stock in term of C#? 

A public class Stock{ decimal currentPrice; public decimal CurrentPrice{ get{return currentPrice;} set{currentPrice=value;} } } 

B public class Stock{ public decimal CurrentPrice{ set;get; } } 

C public class Stock{ ; public decimal CurrentPrice{ get(); set(); } 

D public class Stock{ decimal currentPrice; public decimal CurrentPrice{ return get; set=value; } 

+ Answer
+ Report
Total Preview: 1059

Copyright © 2024. Powered by Intellect Software Ltd