constants-readonly/const-readonly-simple-legal.cs - Legal use of constants and readonly variables. | Lecture 3 - slide 18 : 29 Program 1 |
using System; class ConstDemo { const double ca = 5.0, cb = ca + 1; private readonly double roa = 7.0, rob = Math.Log(Math.E); private readonly BankAccount roba = new BankAccount("Anders"); public ConstDemo(){ // CONSTRUCTOR roa = 8.0; roba = new BankAccount("Tim"); } public static void Main(){ ConstDemo self = new ConstDemo(); self.Go(); } public void Go(){ roba.Deposit(100.0M); } }