🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #18132

Re: how to instantiate n objects during runtime?

#18132
From: John Niesz
Date: Tue, 11 Aug 1998 00:00
10 lines
1033 bytes
just store them in a Vector, using the addElement(Object myObj) function in
the loop, and when you read the objects from the Vector, make sure you cast
them appropriately: ((MyObj)(vec.elementAt(index)));

Mariano Belinky wrote:

> how can I instantiate n objects in runtime? for example, I pass and int
> arg to a for and the loop will instantiate that "quantity" of objects.
>
> Mariano
Technical Details
Message-ID: <35CFCCCB.42DC4D35@worldnet.att.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <35C0B31A.67C3E6C4@lacapitaldelplata.com.ar>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,346c7386d6fb7b82
X-Google-Attributes: gidf74b3,public
From: John Niesz <sunrunner15@worldnet.att.net>
Subject: Re: how to instantiate n objects during runtime?
Date: 1998/08/11
Message-ID: <35CFCCCB.42DC4D35@worldnet.att.net>
X-Deja-AN: 379945042
Content-Transfer-Encoding: 7bit
References: <35C0B31A.67C3E6C4@lacapitaldelplata.com.ar>
To: Mariano Belinky <mbelinky@lacapitaldelplata.com.ar>
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language