Java homeworks