Can you connect 2 ethernet cables together?

Can you connect 2 ethernet cables together?