Exemple #1
0
        static void Main(string[] args)
        {
            SportsCar myCar = new SportsCar();

            myCar.PetName = "my beat up sienna";
            Console.WriteLine("My car: {0}", myCar.getPetName());
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SportsCar myCar = new SportsCar();

            myCar.PetName = "Mustang";
            Console.WriteLine("My car: {0},\t{1}", myCar.getPetName(), myCar.PetName);
        }
        static void Main(string[] args)
        {
            SportsCar myCar = new SportsCar();

            myCar.PetName = "my beatup Sienna";
            Console.WriteLine("My car: \"{0}\",\t{1}", myCar.getPetName(), myCar.PetName);
        }
Exemple #4
0
        static void Main(string[] args)
        {
            //making title beatiful
            Console.Title           = "Car Lab";
            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("__Welcome to my car class practice lab.___");

            //initiating SportsCar object
            SportsCar sc = new SportsCar();

            //calling the PrintName method from the initiated object
            sc.PrintName();
        }