[java] Ascending and Descending Number Order in java