# \[SOLVED\] Class problem with ArrayList

**URL:** <https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475>\
**Category:** Beginners\
**Created:** [July 3, 2019, 1:31pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475 "2019-07-03T13:31:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zephyr](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Zephyr](https://discourse.processing.org/u/Zephyr)\
**Post date:** [July 3, 2019, 1:31pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/1 "2019-07-03T13:31:59Z")

</div>

Hi, I’m a beginner on Processing (thanks to Coding Train btw). I love it and I’ve just achieved a prog about the Fourier decomposition (3Blue1Brown’s videos are really inspiring). I want now to “draw” in this Fourier style. But I encountered an unexpected error : a problem of “unexisting class”. I can’t find the error so please be nice and help me !  
My code :  
First page

```auto
ArrayList<Circle> rain = new ArrayList<Circle>();

```

Second page

```auto
class Circle {
  float RADIUS_FIRST = 10;
  float RADIUS_AFTER = 32;
  float pos_x;
  float pos_y;
  float radius;
  
  Circle(){
    pos_x = 0;
    pos_y = 0;
    radius = RADIUS_FIRST;
  }
  
  Circle(float x_, float y_){
    radius = RADIUS_AFTER;
    pos_x = x_;
    pos_y = y_;
  }
  
  void display(){
   stroke(1);
   fill(0);
   ellipse(pos_x, pos_y, radius*2, radius*2); 
  }
}

```

What’s the problem here ? Because I verified the syntax on another program (Purple Rain code by Coding Train I think) and it seems to be the same, but…no. 😅

---

<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:** [July 3, 2019, 1:39pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/2 "2019-07-03T13:39:36Z")

</div>

[Processing.org/reference/setup\_.html](http://Processing.org/reference/setup_.html)

1st tab:

```auto
final ArrayList<Circle> rain = new ArrayList<Circle>();

void setup() {
}

```

2nd tab:

```auto
class Circle {
}

```

---

<div class="post-metadata">

**Author:** ![Zephyr](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Zephyr](https://discourse.processing.org/u/Zephyr)\
**Post date:** [July 3, 2019, 2:00pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/3 "2019-07-03T14:00:23Z")

</div>

So the only problem was that there wasn’t any void loop ?

---

<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:** [July 3, 2019, 2:08pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/4 "2019-07-03T14:08:19Z")

</div>

Well, I don’t see neither **setup()** nor **draw()** callbacks in your posted code. 😶

---

<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:** [July 3, 2019, 2:13pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/5 "2019-07-03T14:13:40Z")

</div>

Here’s an example sketch w/ a main tab file named “pjs-java.pde” w/ classes Ball & Chamber in their own corresponding “.pde” tab files: 🤠

- [Github.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-java](http://Github.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-java)
- [GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-java](http://GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-java)

---

<div class="post-metadata">

**Author:** ![Zephyr](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Zephyr](https://discourse.processing.org/u/Zephyr)\
**Post date:** [July 4, 2019, 5:36pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/6 "2019-07-04T17:36:17Z")

</div>

Thanks !! Was about to go crazy !

---

<div class="post-metadata">

**Author:** ![Zephyr](https://avatars.discourse-cdn.com/v4/letter/z/13edae/32.png) [@Zephyr](https://discourse.processing.org/u/Zephyr)\
**Post date:** [July 4, 2019, 5:40pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/7 "2019-07-04T17:40:03Z")

</div>

How am I supposed to put this subject as a “Solved” one ?

---

<div class="post-metadata">

**Author:** ![InferNova](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/infernova/32/6009_2.png) [@InferNova](https://discourse.processing.org/u/InferNova)\
**Post date:** [July 4, 2019, 6:14pm UTC](https://discourse.processing.org/t/solved-class-problem-with-arraylist/12475/8 "2019-07-04T18:14:46Z")

</div>

Hey There!

Unfortunately there’s not button (yet). What you can do is put it in the title.
