Java second task