ElementB then implements accept(visitor) by dispatching to visitor.visitElementB(this). The Visitor1 class implements the operation (visitElementB(e:ElementB)).
elementb then implements accept(visitor) by dispatching to visitorvisitelementb(this) the visitor1 class implements the operation (visitelementb(eelementb))