how to print numbers horizontally in java