示例#1
0
        static void Main(string[] args)
        {
            DrinkMachine myMachine = new DrinkMachine(); // created a new object

            // start assgining value
            myMachine._location = "kitchen"; // assign value to member variable
            myMachine._model    = "DM1000";

            Console.WriteLine(myMachine._location); // output the information to the screen
            myMachine.MakeCappuccino();             // call that method
        }
示例#2
0
        static void Main(string[] args)
        {
            DrinkMachine myMachine = new DrinkMachine("Kitchen", "Brand", "DM1000");

            // myMachine._location = "kitchen"; - No longer needed
            // myMachine._model = "DM1000";

            Console.WriteLine(myMachine.Location);
            Console.WriteLine(myMachine.Make);
            Console.WriteLine(myMachine.Model);

            myMachine.MakeCappuccino();
        }