Re: array initilization and memory usage
- From: "Xavier Tarrago" <xavier.tarrago@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 10:01:26 +0200
I don't think so. new Bar[500] will alocate an array of references. Each
bars[i] = new Bar() will allocate a Bar so you'll end with an array of 400
references and 5 Bar allocated.
<jon23d@xxxxxxxxx> a écrit dans le message de
news:1151298741.400576.235390@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I'm a little new here, so please bear with me if this sounds like a
goofy
question!...
let's say that I have an class with 15 or so members, each taking up a
fair
amount of space - we'll call this class bars
If I create an array of 400 empty bars objects, but only instantiate
the
first five or so then am I still setting aside the memory for the other
395?
I hope that made sense!
Thanks
.
- Follow-Ups:
- Re: array initilization and memory usage
- From: ge0rge
- Re: array initilization and memory usage
- References:
- array initilization and memory usage
- From: jon23d
- array initilization and memory usage
- Prev by Date: Re: SendMailServlet example & server setup ?
- Next by Date: Problem with JFormattedTextField - Number field
- Previous by thread: array initilization and memory usage
- Next by thread: Re: array initilization and memory usage
- Index(es):
Relevant Pages
|