🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #698

Re: working with arraylist

#698
From: fungus
Date: Mon, 22 May 2000 00:00
28 lines
1685 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.

MyClass m = (MyClass)myArrayList.get(index);

m.someMethod();


-- 
<\___/>
/ O O \
\_____/  FTB.
Technical Details
Message-ID: <392956B1.3E39FBD4@egg.chips.and.spam.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <958984148.685705@brs.ihug.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113ae9,3ab74ead81e4ec2b
X-Google-Attributes: gid113ae9,public
X-Google-Thread: fdb77,3ab74ead81e4ec2b
X-Google-Attributes: gidfdb77,public
X-Google-Thread: 10d6db,3ab74ead81e4ec2b
X-Google-Attributes: gid10d6db,public
From: fungus <spam@egg.chips.and.spam.com>
Subject: Re: working with arraylist
Date: 2000/05/22
Message-ID: <392956B1.3E39FBD4@egg.chips.and.spam.com>
X-Deja-AN: 625891785
Content-Transfer-Encoding: 7bit
References: <958984148.685705@brs.ihug.com.au>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@teleline.es
X-Trace: telenews.teleline.es 959010507 213.0.67.223 (Mon, 22 May 2000 17:48:27 MET DST)
Organization: Clientes_Teleline
MIME-Version: 1.0
NNTP-Posting-Date: Mon, 22 May 2000 17:48:27 MET DST
Newsgroups: aus.computers.java,comp.lang.java.advocacy,comp.lang.java.help