fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. Exemplo obj = new Exemplo();
  8. obj.Status = Status.Ativo;
  9.  
  10. Console.WriteLine("Status: " + obj.Status);
  11. }
  12. }
  13.  
  14. public class Exemplo
  15. {
  16. public Status Status {get;set;} = Status.Ativo;
  17.  
  18.  
  19. public enum Status
  20. {
  21. Ativo,
  22. Deletado
  23. }
  24. }
  25.  
  26.  
Compilation error #stdin compilation error #stdout 0.03s 15308KB
stdin
Standard input is empty
compilation info
prog.cs(19,14): error CS0102: The type `Exemplo' already contains a definition for `Status'
prog.cs(16,16): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty