Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Car oneCar = new Car("Chevrolet", "Traverse", 2015, "White");

            Car.MyMethod();

            /*oneCar.Make = "Chevrolet";
             * oneCar.Model = "Traverse";
             * oneCar.Year = 2015;
             * oneCar.Color = "White";*/

            Car twoCar = new Car();   //constructor auto-generated

            //twoCar = oneCar;       //referencing the same memory address
            twoCar.Make  = "Dodge";
            twoCar.Model = "Journey";
            twoCar.Year  = 2014;
            twoCar.Color = "Black";


            Console.WriteLine("Make: " + oneCar.Make + ", Model: " + oneCar.Model);
            Console.WriteLine("Value: {0:C}", oneCar.DetermineMarketValue());

            //decimal value = CalculateMarketValue(oneCar);
            //Console.WriteLine("{0:C}", value);


            oneCar = null;
        }