Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public interface IVehicle{
  2. void Drive();
  3. void Fly();
  4. }
  5. public class MultiFunctionalCar : IVehicle{
  6. public void Drive(){
  7. Console.WriteLine("Drive a multifunctional car");
  8. }
  9. public void Fly(){
  10. Console.WriteLine("Fly a multifunctional car");
  11. }
  12. }
  13. public class Car : IVehicle{
  14. public void Drive(){
  15. Console.WriteLine("Driving a car");
  16. }
  17. public void Fly(){
  18. throw new NotImplementedException();
  19. }
  20. }
  21. public class Airplane : IVehicle{
  22. public void Drive(){
  23. throw new NotImplementedException();
  24. }
  25. public void Fly(){
  26. Console.WriteLine("Flying a plane");
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement