(Even more) Problems n solutions in java