Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. namespace ConsoleApp2
  2. {
  3. class Program
  4. {
  5.  
  6. static void Main(string[] args)
  7. {
  8. Bicycle[] bicycles = new Bicycle[3];
  9. Vehicle[] vehicles = (Vehicle)bicycles;
  10. vehicles[0] = new Car();
  11. bicycles[0].RiderMyBiceycle();
  12. }
  13. }
  14.  
  15. internal class Car : Vehicle
  16. {
  17. }
  18.  
  19. internal class Vehicle
  20. {
  21. public Vehicle()
  22. {
  23. }
  24.  
  25. public static implicit operator Vehicle(Bicycle[] v)
  26. {
  27. throw new NotImplementedException();
  28. }
  29.  
  30. public static implicit operator Vehicle[](Vehicle v)
  31. {
  32. throw new NotImplementedException();
  33. }
  34. }
  35. internal class Bicycle
  36. {
  37. internal void RiderMyBiceycle()
  38. {
  39. throw new NotImplementedException();
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement