# Calling arraylist object function on entire arraylist

**URL:** https://discourse.processing.org/t/calling-arraylist-object-function-on-entire-arraylist/25813
**Category:** Beginners
**Created:** [November 29, 2020, 4:50pm UTC](https://discourse.processing.org/t/calling-arraylist-object-function-on-entire-arraylist/25813 "2020-11-29T16:50:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ScriptKiddie](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@ScriptKiddie](https://discourse.processing.org/u/ScriptKiddie)
#### Post date: [November 29, 2020, 4:50pm UTC](https://discourse.processing.org/t/calling-arraylist-object-function-on-entire-arraylist/25813/1 "2020-11-29T16:50:34Z")

</div>

Hi everyone,

pseudocode below:

```auto
class Class
{
   void function()
   {
      instruction performed by object;
   }
}

ArrayList<Class> objectList = new ArrayList(100);

for(int i = 0; i < 100; i++)
{
   objectList.get(i).Function();
}

```

my question is, is it possible to call this function on every object without a loop?  
so something like ArrayList.Function()?

---

<div class="post-metadata">

### Author: ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)
#### Post date: [November 29, 2020, 5:14pm UTC](https://discourse.processing.org/t/calling-arraylist-object-function-on-entire-arraylist/25813/2 "2020-11-29T17:14:49Z")

</div>

for (final Class c : objectList) c.function();

> **[for \\ Language (API) \\ Processing 3+](https://Processing.org/reference/for.html)**
