You can use code example from Wikipedia, where:
Class VisitorDemo
is the Client rectangle.
Classes Wheel, Engine, Body, Car
is elements triangle, and ICarElement
is their abstract parent with void accept(ICarElementVisitor visitor);
as Accept (abstract Visitor) oval.
Classes CarElementPrintVisitor, CarElementDoVisitor
are at the same time Ops oval and Visitors triangle with
void visit(Wheel wheel);
void visit(Engine engine);
void visit(Body body);
void visit(Car car);
as Visit oval.