Solutions of java homework tasks.