public static void TestClass() { Console.WriteLine("creating wrapper..."); MyResourceWrapper wrapper = new MyResourceWrapper(); Console.WriteLine("using wrapper..."); }
//~Program() //{ // object // Console.WriteLine(" prOGRAM CLASS Finalizer "); //} static void Main(string[] args) { MyResourceWrapper rw = new MyResourceWrapper(); //Console.WriteLine("***** Fun with Finalizers *****\n"); //Console.WriteLine("Hit the return key to shut down this app"); //Console.WriteLine("and force the GC to invoke Finalize()"); //Console.WriteLine("for finalizable objects created in this AppDomain."); ////MyResourceWrapper rw2 = new MyResourceWrapper(); ////Program program = new Program(); /// using (Student stu = new Student()) { // logic , data } Student stu2 = new Student(); //stu.Dispose(); Console.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("*** Fun With Finalizers ****"); Console.WriteLine("Hit enter to initiate finalize() method"); Console.ReadLine(); MyResourceWrapper rw = new MyResourceWrapper(); }
static void Main(string[] args) { Console.WriteLine("***** Fun with Finalizers *****\n"); Console.WriteLine("Hit the return key to shut down this app"); Console.WriteLine("and force the GC to invoke Finalize()"); Console.WriteLine("for finalizable objects created in this AppDomain."); Console.ReadLine(); MyResourceWrapper rw = new MyResourceWrapper(); }
static void Main( string[] args ) { Console.WriteLine("***** Fun with Finalizers *****\n"); Console.WriteLine("Hit the return key to shut down this app"); Console.WriteLine("and force the GC to invoke Finalize()"); Console.WriteLine("for finalizable objects created in this AppDomain."); Console.ReadLine(); MyResourceWrapper rw = new MyResourceWrapper(); }
private static void CreateObjects(int count) { MyResourceWrapper[] tonsOfObjects = new MyResourceWrapper[count]; for (int i = 0; i < count; i++) { tonsOfObjects[i] = new MyResourceWrapper(); } tonsOfObjects = null; }
static void Finalization() { Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine("=> finalizers"); Console.WriteLine("Hit the return key to shut down this app"); Console.WriteLine("and force the GC to invoke Finalize()"); Console.WriteLine("for finalizable objects created in this AppDomain."); Console.ReadLine(); MyResourceWrapper rw = new MyResourceWrapper(); }
static void Main(string[] args) { Debug.WriteLine("***** Fun with Finalizers *****\n"); Debug.WriteLine("Hit the return key to shut down this app"); Debug.WriteLine("and force the GC to invoke Finalize()"); Debug.WriteLine("for finalizable objects created in this AppDomain."); // Нажмите клавишу <Enter>, чтобы завершить приложение // и заставить сборщик мусора вызвать метод Finalize () // для всех финализируемых объектов, которые // были созданы в домене этого приложения. var rw = new MyResourceWrapper(); }
static void Main(string[] args) { MyResourceWrapper a = new MyResourceWrapper(); }
static void tmp1() { MyResourceWrapper rw = new MyResourceWrapper(); }