DXC Technology interview question

Encapsulation in java