fork download
  1. struct Mutable {
  2. private int x;
  3. public int Mutate() {
  4. this.x = this.x + 1;
  5. return this.x;
  6. }
  7. }
  8.  
  9. class Test {
  10. public readonly Mutable m = new Mutable();
  11. static void Main(string[] args) {
  12. Test t = new Test();
  13. System.Console.WriteLine(t.m.Mutate());
  14. System.Console.WriteLine(t.m.Mutate());
  15. System.Console.WriteLine(t.m.Mutate());
  16. }
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/155448/101
Success #stdin #stdout 0.02s 15852KB
stdin
Standard input is empty
stdout
1
1
1