Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #1350
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!novia!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | Lew <lewbloch@gmail.com> |
| Newsgroups | comp.lang.java.help |
| Subject | Re: Disposing of Objects? |
| Date | Tue, 15 Nov 2011 13:00:13 -0800 (PST) |
| Organization | http://groups.google.com |
| Lines | 38 |
| Message-ID | <32338133.385.1321390813619.JavaMail.geo-discussion-forums@prfb5> (permalink) |
| References | <752b3c45-6455-4f52-8cf8-d2ba7714b51f@p16g2000yqd.googlegroups.com> <j9tv9q$dvi$1@dont-email.me> <14847360.425.1321373842152.JavaMail.geo-discussion-forums@prgt40> <a6100ea3-c1bd-450e-9750-1277fc00c8bd@w1g2000vba.googlegroups.com> |
| Reply-To | comp.lang.java.help@googlegroups.com |
| NNTP-Posting-Host | 2620:0:1000:2404:224:d7ff:fe69:5838 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1321390902 31421 127.0.0.1 (15 Nov 2011 21:01:42 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Tue, 15 Nov 2011 21:01:42 +0000 (UTC) |
| In-Reply-To | <a6100ea3-c1bd-450e-9750-1277fc00c8bd@w1g2000vba.googlegroups.com> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=2620:0:1000:2404:224:d7ff:fe69:5838; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.help:1350 |
Show key headers only | View raw
Davej wrote:
> Lew wrote:
>> [...]
>>
>> What do you mean by "reinstantiating"?
>>
>
>
> I have q declared as a global inside the main class...
No, you don't.
Java doesn't have globals.
> public class MortgageView extends FrameView {
> Mortgage q;//globals
That isn't even 'static', much less "global".
Stop calling that "global". It's the very opposite of global.
> ...then inside the button event handler I execute...
>
> q = new Mortgage(amt, term, int);//creates table
Creates a new instance of 'Mortgage', then assigns the pointer value (*not* the object) to 'q'.
Whatever pointer value 'q' used to hold is now gone from 'q', erased by the new pointer value.
Yes, I am repeating what others have been saying.
> ...if the button is pressed again the statement is executed again. I
> would call this "reinstantiation."
And you would be wrong.
--
Lew
Back to comp.lang.java.help | Previous | Next — Previous in thread | Next in thread | Find similar
Disposing of Objects? Davej <galt_57@hotmail.com> - 2011-11-15 06:59 -0800
Re: Disposing of Objects? markspace <-@.> - 2011-11-15 07:08 -0800
Re: Disposing of Objects? Lew <lewbloch@gmail.com> - 2011-11-15 08:17 -0800
Re: Disposing of Objects? Davej <galt_57@hotmail.com> - 2011-11-15 09:56 -0800
Re: Disposing of Objects? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-15 10:10 -0800
Re: Disposing of Objects? Davej <galt_57@hotmail.com> - 2011-11-15 12:15 -0800
Re: Disposing of Objects? markspace <-@.> - 2011-11-15 12:51 -0800
Re: Disposing of Objects? Lew <lewbloch@gmail.com> - 2011-11-15 13:00 -0800
Re: Disposing of Objects? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-15 21:59 -0500
Re: Disposing of Objects? markspace <-@.> - 2011-11-15 19:13 -0800
Re: Disposing of Objects? Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-15 22:32 -0500
Re: Disposing of Objects? Davej <galt_57@hotmail.com> - 2011-11-15 08:08 -0800
Re: Disposing of Objects? markspace <-@.> - 2011-11-15 08:32 -0800
Re: Disposing of Objects? Lew <lewbloch@gmail.com> - 2011-11-15 12:57 -0800
Re: Disposing of Objects? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-16 06:23 -0800
csiph-web