private static void Main() { using (var component = new SimpleComponent()) { for (int i = 0; i < 10; i++) { Console.WriteLine(component.Welcome("Stephanie")); } } }
static void Main(string[] args) { // using is used to release the object before GC performs the cleanup using (SimpleComponent obj = new SimpleComponent()) { Console.WriteLine(obj.GetType().ToString()); for (int i = 0; i < 10; i++) { Console.WriteLine(obj.Welcome("Vaibhav")); } } }