need a java code for this question!

Printable View