static void DisposeMethod() { String example = "Hola con dispose"; DisposeExercice exercice = new DisposeExercice(example); exercice.DisposeFunction(); Console.WriteLine($"Usando dispose{exercice}"); Console.Read(); }
static void UsingMethod() { String example = "Hola con using"; using (DisposeExercice exercice = new DisposeExercice(example)) { Console.WriteLine($"Usando using: {exercice}"); Console.Read(); } }