When you design classes you often make the properties they hold private or protected so outside code cant mess with the innards.
But what if you want to allow that – sometimes ?
This is the notion of a “friend”. Another class that you can literally say “yeah its ok I know them and it’s OK if they mess with my innards as they are my friend”.… Read the rest