educative.io

Educative

I dont see anything broken with Missile, BetterMissile example. what am I missing?

In Visitor Pattern - Software Design Patterns: Best Practices for Software Developers
I dont see anything broken with Missile, BetterMissile example. what am I missing?

Expected output
F16 fired ordinary missile: baaaam
Better F16 fired ordinary missile: baaaam

Failed double dispatch attempt
F16 fired ordinary missile: very very big baaam
Better F16 fired ordinary missile: very very big baaam

Expected output
F16 fired better missile: very very big baaam
Better F16 fired better missile: very very big baaam