private static and const Fields : private « Class « C# / CSharp Tutorial






using System;

    class MainClass
    {
        static void Main(string[] args)
        {
            MyTV tv = new MyTV();
        }
    }
    public class MyTV
    {
        public MyTV()
        {
            channel = 2;
        }
        private static int channel = 2;
        private const int maxChannels = 200;
    }








7.16.private
7.16.1.Define private constructors to make a singleton
7.16.2.Use Properties to get and set private member variable
7.16.3.private static and const Fields
7.16.4.Using Methods to change private fields