# Creating class variations using implements

**URL:** <https://discourse.processing.org/t/creating-class-variations-using-implements/4328>\
**Category:** Processing for Android\
**Created:** [October 10, 2018, 1:40pm UTC](https://discourse.processing.org/t/creating-class-variations-using-implements/4328 "2018-10-10T13:40:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonadgranny](https://avatars.discourse-cdn.com/v4/letter/g/a88e4f/32.png) [@gonadgranny](https://discourse.processing.org/u/gonadgranny)\
**Post date:** [October 10, 2018, 1:40pm UTC](https://discourse.processing.org/t/creating-class-variations-using-implements/4328/1 "2018-10-10T13:40:16Z")

</div>

I would like to create a variation of a class i have written and `extends` works well but i am limited to using it only once for some strange reason. i have been looking at `implements` as advised but i cant seem to get my head around it. the reason `extends` works well is because the new class inherits all of the data and methods as the other class but you can add more. with `implements` whenever i add a new method it wont compile and the data is not shared between the implementations…if anyone understands what i am trying to say and has a suggestion id be very grateful, thanks.

---

<div class="post-metadata">

**Author:** ![gonadgranny](https://avatars.discourse-cdn.com/v4/letter/g/a88e4f/32.png) [@gonadgranny](https://discourse.processing.org/u/gonadgranny)\
**Post date:** [October 10, 2018, 3:00pm UTC](https://discourse.processing.org/t/creating-class-variations-using-implements/4328/2 "2018-10-10T15:00:23Z")

</div>

…ok so i have just created multiple variations of a class using `extends`. why does it say this in the documentation?

> Note that in Java, and therefore also Processing, you cannot extend a class more than once. Instead, see **implements**.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [October 10, 2018, 3:18pm UTC](https://discourse.processing.org/t/creating-class-variations-using-implements/4328/3 "2018-10-10T15:18:16Z")

</div>

> [@gonadgranny](#):
>
> Note that in Java, and therefore also Processing, you cannot extend a class more than once. Instead, see **implements**.

Yes, that’s backwards. A class cannot (directly) extend more than one other class would be more accurate.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [October 11, 2018, 8:45am UTC](https://discourse.processing.org/t/creating-class-variations-using-implements/4328/4 "2018-10-11T08:45:45Z")

</div>

@gonadgranny===  
that s simple:

- with java a class can extend only one another class
- but a class can implement more than one interface
