daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Jan 20th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Widget : Gear
  2. {
  3.     public override string Spin()
  4.     {
  5.         return "crunch";
  6.     }
  7. }
  8.  
  9. public class Gear
  10. {
  11.     public virtual string Spin()
  12.     {
  13.         return "whirr";
  14.     }
  15. }
  16.    
  17. var widget = new Widget();
  18. for (var i = 0; i < 1000; i++)
  19. {
  20.    Console.WriteLine(widget.Spin());
  21. }
  22.    
  23. > ...
  24. > crunch
  25. > crunch
  26. > crunch
  27. > whirr
  28. > crunch
  29. > ...
  30.    
  31. class Gear {
  32.   public virtual string Spin() {
  33.     return "whirr";
  34.   }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top