Visitors also arose out of a need to be able to add behaviors to an interface, but without modifying the implementations of other classes.

Q :
Why use visitors when you have switch with pattern matching in Java? https://www.reddit.com/r/programming/comments/1pepblq/comment/nsi2j8m/ https://www.reddit.com/r/programming/comments/1pepblq/comment/nsruhlf/