velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias David <Matthias.Da...@ptv.de>
Subject RE: Access array objects by index
Date Fri, 28 Mar 2003 14:31:44 GMT
Well, if that was true the following code would compile:

       String[] arr = new String[2];
       arr[1] = "string";
       System.out.println(arr.get(1));

But arrays don't have a "get" or "set" method.

Matthias.

-----Original Message-----
From: Denis [mailto:bredelet@mac.com] 
Sent: Friday, March 28, 2003 3:30 PM
To: Velocity Users List
Subject: Re: Access array objects by index


Matthias,

You need to go the Java side to access objects within an array by their 
index.
It's usually:

$arr.get(23)

-- Denis.


On Friday, March 28, 2003, at 02:16  pm, Matthias David wrote:

> Hi,
>
> I'm trying to access objects within an array by their index, like this
>
> $arr[23]
>
> But that does not seem to work. Is there another syntax to access 
> array objects?
>
> Thanks,
>  Matthias.


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message