What is Sonar Used for?

Sonar is used by submarines to send out an echo. When the signal comes back it shows them what is in from of them. That is an amazing invention!