Do Cantrips stack when you multiclass Spellcasting class of the same casting type (Wizard, Edlrich Knight, Arcane Trickster)?

Do Cantrips stack when you multiclass Spellcasting class of the same casting type (Wizard, Edlrich Knight, Arcane Trickster)?

Ex: Lv 10 Arcane Trickster has 4 cantrips & Lv 10 Wizard has 5. Does the mean this PC knows 9 cantrips?

When I multiclass Sorcerer/Wizard do I unlearn a cantrip?

Sadly this did not help as they used two different spellcasting type.