how to print 1 to 10 without using loop in java