How would I write this in Java?

Printable View