Re: creating a new instance
- From: "Claus Petersen" <claus$E30@xxxxxxxxxxxxxxx>
- Date: Tue, 24 May 2005 15:14:46 +0200
"Tony Johansson" <johansson.andersson@xxxxxxxxx> skrev i en meddelelse
news:QCFke.138298$dP1.487265@xxxxxxxxxxxxxxxxxx
> Hello!!
>
> Here I create a new instance t of class Test and pass the referenc to
> method goo.
> When this method foo eventually finish will this instace t go out of scope
> and be garbage collected.?
> If not exactly what must occur so that the instance t be garbage
> collected.
>
> void foo()
> {
> Test t = new Test;
> goo(t);
> }
>
> //Tony
>
>
Short anwer: YES.......
But if you want to be sure, then set t = null; after the call to goo
Claus
.
- Follow-Ups:
- Re: creating a new instance
- From: Raymond DeCampo
- Re: creating a new instance
- From: Casper B
- Re: creating a new instance
- References:
- creating a new instance
- From: Tony Johansson
- creating a new instance
- Prev by Date: creating a new instance
- Next by Date: Re: creating a new instance
- Previous by thread: creating a new instance
- Next by thread: Re: creating a new instance
- Index(es):
Relevant Pages
|
|