Sonar:
SONAR stands for sound navigation and ranging.
It is a device which is used by ships and submarines to locate position of other vessels in the ocean. These are of two types, One is passive, which only detects the incoming. Another one is active SONAR which transmits sound pulses and detects the reflected echoes to detect presence of other sea vessels.
Radar:
The full form of RADAR is Radio Detection And Ranging.
It normally used in navigational, astronomical and military purposes. It consists of a radio transmitter, which emits electromagnetic waves and detector used for detecting incoming radiation, which bounces back from the object under study (like an enemy plane or a ship).
It consists of a single antenna which can do both transmitting and receiving as it switches back and forth between the two. The antenna is in a constant rotation (about a fixed axis) as as to cover the entire sky.