Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Luser luser = new Luser("Arska");
            User  user1 = new User(luser);
            User  user2 = new User(new Luser("Yuri"));

            user1 = null;
            user2 = null;
            GC.Collect(); //  User is destructed,  User is destructed, User Yuri is destructed
            Console.ReadLine();
            // Luser Arska is destructed
        }
Exemplo n.º 2
0
 public User(Luser luser)
 {
     this._luser = luser;
 }