Solutions of java homeworks.