This reference is for Processing 2.0+. If you have a previous version, use the reference included with your software. If you see any errors or have suggestions, please let us know. If you prefer a more technical reference, visit the Processing Javadoc.

Name | ### println()
Examples |
    String s = "The size is ";
    int w = 1920;
    int h = 1080;
    println(s);
    println(w, "x", h);

    // This program writes to the console:
    // The size is
    // 1920 x 1080
    print("begin- ");
    float f = 0.3;
    int i = 1024;
    print("f is " + f + " and i is " + 1024);
    String s = " -end";
    println(s);

    // This program writes to the console:
    // "begin- f is 0.3 and i is 1024 -end"
Description | The print() function writes to the console area, the black rectangle at the bottom of the Processing environment. This function is often helpful for looking at the data a program is producing. Each call to this function creates a new line of output. More than one parameter can be passed into the function by separating them with commas. Alternatively, individual elements can be separated with quotes ("") and joined with the addition operator (+). Before Processing 2.1, println() was used to write array data to the console. Now, use printArray() to write array data to the console.
Syntax |
    println()
    println(what)
    println(variables)
Parameters |
what | Object, String, float, char, boolean, or byte: data to print to console
variables | Object[]: list of data, separated by commas
Returns | void
Related | print() printArray()

Updated on October 26, 2013 08:58:30pm PDT