fork download
  1. using System;
  2.  
  3. public class Program { public static void Main() {} }
  4.  
  5. public class Pessoa : ICloneable {
  6. public string Nome;
  7. public Pessoa Conjuge;
  8. public object Clone() {
  9. var p = new Pessoa();
  10. p.Nome = Nome;
  11. if (Conjuge != null) p.Conjuge = (Pessoa)Conjuge.Clone();
  12. return p;
  13. }
  14. }
  15.  
  16. public class Pessoa2 : ICloneable {
  17. public string Nome;
  18. public Pessoa2 Conjuge;
  19. public object Clone() => MemberwiseClone();
  20. }
  21.  
  22. //https://pt.stackoverflow.com/q/156883/101
Success #stdin #stdout 0.01s 13856KB
stdin
Standard input is empty
stdout
Standard output is empty