# Where is the class "Print" defined?

**URL:** <https://community.particle.io/t/where-is-the-class-print-defined/33848>\
**Category:** Firmware\
**Created:** [June 15, 2017, 8:31pm UTC](https://community.particle.io/t/where-is-the-class-print-defined/33848 "2017-06-15T20:31:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fguptill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/fguptill/32/11589_2.png) [@fguptill](https://community.particle.io/u/fguptill)\
**Post date:** [June 15, 2017, 8:31pm UTC](https://community.particle.io/t/where-is-the-class-print-defined/33848/1 "2017-06-15T20:31:10Z")

</div>

I’m using the ADAFRUIT\_SSD1306 library from GitHub.  
One of the example programs contains the line  
"display.println(“Hello, world!”);  
The entity ‘display’ is an instantiation of Adafruit\_SSD1306.  
The class Adafruit\_SSD1306 contains no function called ‘println’,  
but the class Adafruit\_SSD1306 inherits public member from the class Adafruit\_GFX,  
so ‘println’ must inherit its membership in class Adafruit\_SSD1306 from class Adafruit\_GFX.  
Class Adafruit\_GFX has no member called ‘println’, but it does inherit public members from a class called “Print”.  
It seems clear that println must be a direct member of Print, but where is Print defined? I’ve looked high and  
low and can find no object called “Print”. It seems obvious that it must be a system-defined class, but where is it  
located?  
I’m stumped.

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [June 15, 2017, 8:38pm UTC](https://community.particle.io/t/where-is-the-class-print-defined/33848/2 "2017-06-15T20:38:57Z")

</div>

Hi @fguptill

The class Print is part of the Arduino-compatible Wiring language and is defined in a system file here:

> <https://github.com/particle-iot/firmware/blob/develop/wiring/inc/spark_wiring_print.h>

Lots of classes inherit Print or the related class Printable since it knows how to, well, print various things. Print itself usually calls the lower level write method which often is overloaded in the original library (your display library).

---

<div class="post-metadata">

**Author:** ![fguptill](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/fguptill/32/11589_2.png) [@fguptill](https://community.particle.io/u/fguptill)\
**Post date:** [June 16, 2017, 10:32pm UTC](https://community.particle.io/t/where-is-the-class-print-defined/33848/3 "2017-06-16T22:32:54Z")

</div>

Thanks bko, that exactly answers my question. Is there a line in my code that calls up these utilities, or are they just there by default? Is it perhaps “#include application.h”?

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [June 17, 2017, 12:51am UTC](https://community.particle.io/t/where-is-the-class-print-defined/33848/4 "2017-06-17T00:51:51Z")

</div>

They are part of the built-in system firmware that your code can use. They are just there for you.

In your library when you include application.h they become accessible.
