Problem1 in java