using System; public class Person: IDisposable { public int Id { get; set; } public string FullName { get; set; } public int Age { get; set; } public Person() { } public Person(int id, string fullName, int age) { Id = id; FullName = fullName; Age = age; } /// /// Implement interface /// public void Dispose() { //Do somethings here . . . Console.WriteLine("\n Hi boys, This is a final message to you !"); } } public class Test { public static void Main() { using(Person p = new Person(1, "BravoHex", 25), p1 =new Person(), p2 = new Person(3,"Tuan Le Minh",27)) { Console.WriteLine(" Name: {0} \n Age: {1}", p.FullName, p.Age); } Console.ReadKey(); } }