Genesys interview question

how is encapsulation implemented in java?