# Print class variables

**URL:** https://discourse.processing.org/t/print-class-variables/8142
**Category:** Beginners
**Created:** [February 5, 2019, 8:37pm UTC](https://discourse.processing.org/t/print-class-variables/8142 "2019-02-05T20:37:35Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [February 5, 2019, 9:01pm UTC](https://discourse.processing.org/t/print-class-variables/8142/2 "2019-02-05T21:01:55Z")

</div>

A class needs to [`@Override`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Override.html) the [**toString()**](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()) method, so it can return a String w/ the current value of its fields. ☕

Here’s a link w/ an example for it: 🔗

- [Forum.Processing.org/two/discussion/25986/how-can-i-replace-pvector-tostring#Item\_7](http://Forum.Processing.org/two/discussion/25986/how-can-i-replace-pvector-tostring#Item_7)

---

_[View the full topic](https://discourse.processing.org/t/print-class-variables/8142)._
