Need a java code and explanation for this

Printable View