fork download
  1. using System;
  2.  
  3. public class Skillet {
  4. public string Ingredient { get; set; }
  5. public int Quantity { get; set; }
  6.  
  7. public Skillet( string ingredient, int quantity )
  8. {
  9. this.Ingredient = ingredient;
  10.  
  11. this.Quantity = quantity;
  12. }
  13.  
  14. public void fry()
  15. {
  16. Console.WriteLine( "Frying " + this.Quantity + " " + this.Ingredient );
  17. }
  18.  
  19. public void toString()
  20. {
  21. Console.WriteLine( this.Quantity + " " + this.Ingredient );
  22. }
  23. }
  24.  
  25. public class Runner
  26. {
  27. public static void Main()
  28. {
  29. Skillet mySkillet = new Skillet( "bacon strips", 2 );
  30.  
  31. mySkillet.toString();
  32.  
  33. mySkillet.fry();
  34. }
  35. }
  36.  
Success #stdin #stdout 0.01s 38000KB
stdin
Standard input is empty
stdout
2 bacon strips
Frying 2 bacon strips