Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Test interface at Main method
- using System;
- namespace LearnInterfaces
- {
- class Program
- {
- static void Main(string[] args)
- {
- Sedan s1 = new Sedan(60);
- Sedan s2 = new Sedan(70);
- Truck t1 = new Truck(45, 500);
- Console.WriteLine($"The first sedan's speed is: {s1.Speed}, wheels is {s1.Wheels}, and License plate is {s1.LicensePlate}");
- Console.WriteLine($"The second sedan's speed is: {s2.Speed}, wheels is {s2.Wheels}, and License plate is {s2.LicensePlate}");
- Console.WriteLine($"The truck's speed is: {t1.Speed}, wheels is {t1.Wheels}, and License plate is {t1.LicensePlate}");
- //call method
- s1.SpeedUp();
- s2.SpeedUp();
- t1.SpeedUp();
- Console.WriteLine($"Now the first sedan speed is {s1.Speed}");
- Console.WriteLine($"Now the second sedan speed is {s2.Speed}");
- Console.WriteLine($"Now the truck speed is {t1.Speed}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement