How to narrow down the range of input in java?

Printable View