dcsimg
How to iterate over two int arrays simultaneously
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, July 22, 2003 10:15 AM

It would be appreciated if someone could help me out. Say, I have a Java bean with two int arrays, intA, intB of the same size. As an example, say intA={-1,2,4}, intB={2,3,0} How to use logic:iterate to sum the corresponding entries and print out : -1 + 2 = 1 2 + 3 = 5 4 + 0 = 4 More generally, instead of iterating over all the entries, how to iterate up to the (myIndex)th entry, where (int) myIndex is another property in the same Java bean. Thanks in advance ! Shing    More>>

It would be appreciated if someone could help me out.
Say, I have a Java bean with two int arrays, intA, intB of
the same size.

As an example, say intA={-1,2,4}, intB={2,3,0}



How to use logic:iterate to sum the corresponding entries and print out :

-1 + 2 = 1

2 + 3 = 5

4 + 0 = 4



More generally, instead of iterating over all the entries, how to iterate up to the (myIndex)th entry, where (int) myIndex is
another property in the same Java bean.


Thanks in advance !

Shing

   <<Less
About | Sitemap | Contact