Skip to content

Counter

Java class method

Same task in: TypeScriptJavaScript

Flowchart (ISO 5807)

Startvalue = value + 1EndFigure 1 — Counter.inc

Source code

Java
class Counter {
    int value = 0;
    void inc() {
        value = value + 1;
    }
}

The editor opens with this code — change it and the chart redraws.

Language
Java
Constructs
class method
Topic
Classes & methods
Formats
Word, Visio, draw.io, PDF, SVG

Related examples