EY interview question

Encapsulation in OOP with code example