# What type is \`this\` in a sketch?

**URL:** https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676
**Category:** Beginners
**Created:** [November 12, 2022, 12:11am UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676 "2022-11-12T00:11:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![grough](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grough/32/12287_2.png) [@grough](https://discourse.processing.org/u/grough)
#### Post date: [November 12, 2022, 12:11am UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/1 "2022-11-12T00:11:07Z")

</div>

Hi,

When I run this code in a sketch:

```auto
println(this);

```

I see this in the console:

```auto
sketch_221111b@31393958

```

What datatype or class does `this` belong to?

I’m trying to write a function that accepts `this` as an argument, but I got stuck trying to figure out what type the parameter should be.

Thank you

---

<div class="post-metadata">

### Author: ![debxyz](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@debxyz](https://discourse.processing.org/u/debxyz)
#### Post date: [November 12, 2022, 12:31am UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/2 "2022-11-12T00:31:23Z")

</div>

Hello!  
“This” is not a datatype. Read more here:

> **[Java this Keyword](https://www.w3schools.com/java/ref_keyword_this.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

🤓

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [November 12, 2022, 1:03am UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/3 "2022-11-12T01:03:18Z")

</div>

Yes.

See also [Can anyone help explain the following use of "this" and "PApplet"?](https://discourse.processing.org/t/can-anyone-help-explain-the-following-use-of-this-and-papplet/35436)

---

<div class="post-metadata">

### Author: ![grough](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/grough/32/12287_2.png) [@grough](https://discourse.processing.org/u/grough)
#### Post date: [January 20, 2023, 2:11pm UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/4 "2023-01-20T14:11:52Z")

</div>

> I’m trying to write a function that accepts `this` as an argument, but I got stuck trying to figure out what type the parameter should be.

After following the link shared above (marked as solution), I learned that that type of such an argument should be [`PApplet`](https://processing.github.io/processing-javadocs/core/processing/core/PApplet.html). Thanks for your help.

---

<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: [January 20, 2023, 2:53pm UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/5 "2023-01-20T14:53:46Z")

</div>

> [@grough](#):
>
> , I learned that that type of such an argument should be [`PApplet`](https://processing.github.io/processing-javadocs/core/processing/core/PApplet.html).

PApplet is the `super` datatype.

But the actual datatype is the name of the 1st tab w/o the extension “.pde”.

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [January 20, 2023, 3:00pm UTC](https://discourse.processing.org/t/what-type-is-this-in-a-sketch/39676/6 "2023-01-20T15:00:41Z")

</div>

And inside a class it’s the class
