# Where do these methods... live?

**URL:** <https://discourse.processing.org/t/where-do-these-methods-live/27286>\
**Category:** Beginners\
**Created:** [January 21, 2021, 11:22pm UTC](https://discourse.processing.org/t/where-do-these-methods-live/27286 "2021-01-21T23:22:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoHill](https://avatars.discourse-cdn.com/v4/letter/y/7ab992/32.png) [@yoHill](https://discourse.processing.org/u/yoHill)\
**Post date:** [January 21, 2021, 11:22pm UTC](https://discourse.processing.org/t/where-do-these-methods-live/27286/1 "2021-01-21T23:22:56Z")

</div>

Hi, I have a question that may be really stupid but I just can’t quite wrap my head around what’s happening here.

When using methods like void draw() or void mousePressed()… are these part of an interface somewhere? I guess what I’m really asking… is why are we re-specifying the return type if the method already exists?

Thanks for any clarification here…

---

<div class="post-metadata">

**Author:** ![jay\_m](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jay_m/32/11020_2.png) [@jay\_m](https://discourse.processing.org/u/jay_m)\
**Post date:** [January 22, 2021, 1:00am UTC](https://discourse.processing.org/t/where-do-these-methods-live/27286/2 "2021-01-22T01:00:35Z")

</div>

The base class for all sketches that use processing.core is PApplet

simplistic setup() and draw() are [provided there](https://github.com/processing/processing/blob/a6e0e227a948e7e2dc042c04504d6f5b8cf0c1a6/core/src/processing/core/PApplet.java#L1817-L1853) and my understanding is that your sketch auto-magically subclasses this (IDE work) and you provide your own variation of those.

---

<div class="post-metadata">

**Author:** ![micycle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micycle/32/201_2.png) [@micycle](https://discourse.processing.org/u/micycle)\
**Post date:** [January 22, 2021, 2:31pm UTC](https://discourse.processing.org/t/where-do-these-methods-live/27286/3 "2021-01-22T14:31:09Z")

</div>

Adding on to @jay_m’s comment, Processing’s preprocessor takes code (in the Processing IDE) that looks like this…

```auto
void setup() {...}

void draw() {...}

```

…and produces a resulting Java class that looks _something_ like this:

```auto
import processing.core.PApplet;

final class JavaVersion extends PApplet {

	public static void main(String[] args) {
		PApplet.main(JavaVersion.class);
	}

    @Override
    void setup() {...}
    
    @Override
    void draw() {...}

}

```
