Solved ReverseInteger in java