some solutions using java