# Why isn't the ellipse displaying?

**URL:** <https://discourse.processing.org/t/why-isnt-the-ellipse-displaying/28341>\
**Category:** Coding Questions\
**Created:** [March 8, 2021, 3:51pm UTC](https://discourse.processing.org/t/why-isnt-the-ellipse-displaying/28341 "2021-03-08T15:51:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![psn](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@psn](https://discourse.processing.org/u/psn)\
**Post date:** [March 8, 2021, 3:51pm UTC](https://discourse.processing.org/t/why-isnt-the-ellipse-displaying/28341/1 "2021-03-08T15:51:06Z")

</div>

Title is pretty self-explanatory, i need help to see what’s wrong with my code. Any help is appreciated, thanks!

```auto
class Ellipse {
  int x;
  int y;
  int w;
  int h;
  int c;
  Ellipse(int inputX, int inputY, int inputWidth, int inputHeight, color inputColor) {
    inputX = x;
    inputY = y;
    inputWidth = w;
    inputHeight = h;
    inputColor = c;
  }
  void displayEllipse() {
    fill(c);
    ellipse(x, y, w, h);
  }
}

void setup() {
  size(200, 200);
}

void draw() {
  Ellipse myEllipse = new Ellipse(100, 100, 5, 5, 0);
  myEllipse.displayEllipse();
}

```

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [March 8, 2021, 3:58pm UTC](https://discourse.processing.org/t/why-isnt-the-ellipse-displaying/28341/2 "2021-03-08T15:58:32Z")

</div>

Hi,

You inverted the variables in your constructor.  
`inputX = x;` should be `x = inputX;`

Also, it is bad practice to rebuild your object in each draw loop if you are going to reuse it all the time. Instead, move `Ellipse myEllipse = new Ellipse(100, 100, 5, 5, 0);` in setup.
