fork download
  1. using System;
  2.  
  3. public class ContrivedCsharpExample
  4. {
  5. private string _moduleName;
  6.  
  7. protected string moduleName
  8. {
  9. get {
  10. // Perhaps some logging code here that records the moduleName was retrieved.
  11. return this._moduleName;
  12. }
  13. set {
  14. // Some code here that ensure that a valid moduleName was passed.
  15. this._moduleName = value;
  16. }
  17. }
  18.  
  19. public void init(string moduleName) {
  20. this.moduleName = moduleName;
  21. }
  22.  
  23. public void issueAlert() {
  24. Console.WriteLine(this.moduleName);
  25. }
  26.  
  27.  
  28. public static void Main()
  29. {
  30. var module = new ContrivedCsharpExample();
  31.  
  32. module.init("SampleC#Module");
  33. module.issueAlert();
  34. }
  35. }
Success #stdin #stdout 0.02s 24072KB
stdin
Standard input is empty
stdout
SampleC#Module