Advertisement
KodingKid

C# Polymorphism: Car Edition (vroooom)

Apr 16th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. class Vehicle
  2. {
  3.     public void carRevolutions()
  4.     {
  5.         Console.WriteLine("Vrooooooooooooooom")
  6.         }
  7. }
  8. class Car1 : Vehicle
  9. {
  10. public void carRevolutions()
  11.     {
  12.         Console.WriteLine("Vroooooooooooooooooooooooooooooooom")
  13.         }
  14. }
  15. class Car2 : Vehicle
  16. {
  17. public void carRevolutions()
  18.     {
  19.         Console.WriteLine("Vroooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom")
  20.         }
  21. }
  22. class Car3 : Vehicle
  23. {
  24. public void carRevolutions()
  25.     {
  26.         Console.WriteLine("Vroooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooom")
  27.         }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement