Reference for Processing version 1.5. 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

    println("begin");
    float f = 0.3;
    println("f is equal to " + f + " and i is equal to " + 1024);
    String s = "end";
    println(s);

    // The above code prints the following lines:
    // begin
    // f is equal to 0.3 and i is equal to 1024
    // end

    float[] f = { 0.3, 0.4, 0.5 };
    println(f);

    // The above code prints:
    // 0.3
    // 0.4
    // 0.5

Description

Writes to the text area of the Processing environment's console. This is often helpful for looking at the data a program is producing. Each call to this function creates a new line of output. Individual elements can be separated with quotes ("") and joined with the string concatenation operator (+). See print() for more about what to expect in the output.
Calling println() on an array (by itself) will write the contents of the array to the console. This is often helpful for looking at the data a program is producing. A new line is put between each element of the array. This function can only print one dimensional arrays. For arrays with higher dimensions, the result will be closer to that of print().

Syntax

    println(data)

Parameters

data | boolean, byte, char, color, int, float, String, Object, boolean[], byte[], char[], color[], int[], float[], String[], Object[]

Returns | None
Usage | IDE
Related | print() null

Updated on August 30, 2010 04:29:39pm EDT