Article View: aus.computers.java
Article #628Re: working with arraylist
From: James Moey
Date: Tue, 20 Jun 2000 00:00
Date: Tue, 20 Jun 2000 00:00
23 lines
1545 bytes
1545 bytes
someguy wrote: > greetings > > I have created an arraylist, which i have used to store objects of a purpose > desinged class that holds a string and integer, and the toString returns > both in a string "ie return(myString +myInteger);". I would like to know > how to access the methods of my class from the arraylist. > > ie myArrayList.get(index).someMethodFromMyClass > > Interstingly enough, i can create new objects and add them to my list. I > can get the values of these objects, but i cant invoke methods built into > them to modify their values. > > Please if you know how i can access these method i would appreciate it. I think you need to "cast" the object back to the form you need before you can call any of it's method. from James
Technical Details
Message-ID:
<394EBA81.64C3C46A@igelaus.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<958984148.685705@brs.ihug.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb77,3ab74ead81e4ec2b X-Google-Attributes: gidfdb77,public X-Google-Thread: 10d6db,3ab74ead81e4ec2b X-Google-Attributes: gid10d6db,public X-Google-Thread: 113ae9,3ab74ead81e4ec2b X-Google-Attributes: gid113ae9,public From: James Moey <james@igelaus.com.au> Subject: Re: working with arraylist Date: 2000/06/20 Message-ID: <394EBA81.64C3C46A@igelaus.com.au> X-Deja-AN: 636599964 Content-Transfer-Encoding: 7bit References: <958984148.685705@brs.ihug.com.au> X-Accept-Language: en X-Server-Date: 20 Jun 2000 00:34:51 GMT Content-Type: text/plain; charset=us-ascii Organization: QP Australia Pty. Ltd. Mime-Version: 1.0 Newsgroups: aus.computers.java,comp.lang.java.advocacy,comp.lang.java.help