Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            //Constructors save lots of lines of code, no need to do getters and setters for each field
            var merc01 = new Mercedes("CHASSIS1234ABC", "Silver", 2500); // calling the default constructor
            var merc02 = new Mercedes();

            var aClass = new AClass("Chassis123", "Blue", 3000);
            var a104   = new A104("Chassis342", "Green");
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            var merc01 = new Mercedes("CHASIS1234ABC", "Silver", 2500);
            var merc02 = new Mercedes();//calling default constructor constructor Mercedes() from the Mercedes class


            var aclass01  = new AClass("Chassis123", "blue", 2600);
            var a104      = new A104("Chassis 456", "Red", 1800);
            var a104car02 = new A104("Chassis 456", "Red");
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var merc01 = new Mercedez("CHASIS123ABC", "silver", 2500); // calling the default constructor, but we can define it
            var merc02 = new Mercedez();
            var AClass = new AClass("Chassis0000", "blue", 2750);

            var a104 = new A104("Chassis1111", "red", 1875);

            var a104c02 = new A104("Chassis1111", "red");
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            var merc01 = new Mercedes("CHASSIS34623453", "Silver", 5000);
            var merc02 = new Mercedes();

            var aclass = new AClass("CHASSIS123", "Blue", 2500);

            var a104_01 = new A104("CHASSIS456", "Red", 2500);
            var a104_02 = new A104("CHASSIS456", "Red");

            Console.WriteLine(a104_01.GetDescription());
        }
Ejemplo n.º 5
0
 static void Main(string[] args)
 {
     var merc01   = new Mercedes("CHASIS1234ABC", "Silver", 2500);
     var Aclass01 = new AClass("CHASISA38842D", "Blue", 2650);
     var A104_01  = new A104("CHASIS9938FFD", "Green");
 }