Anti-Submarine Warfare (ASW) in WWII used many of the same tools for detection that are still used today - active and passive sonar, aerial reconnaissance, surface radar for detecting periscopes, and plain old-fashioned eyeballing from lookouts with binoculars and incentive.
Surface search radar was used against German U-boats pretty effectively until they mounted detection devices to alert them to radar signals long before they reached their effective range. This was the forerunner of today's modern Electronic Warfare systems. Though active sonar can help detect a submarine, it wasn't really used unless the Destroyer running down a submarine had already attacked, as active sonar is also great at broadcasting your location to any submarine within a very wide radius. Sound travels faster in water than in air, and further as well. While passive sonar is okay, even on today's modern surface ships finding a submarine while traveling at any speed over 10 knots makes too much noise to be very effective, and it was much worse in those days.
Aerial recon is what really changed the tide against the U-boats in the Atlantic. Long range bombers from England and convoy ships outfitted with up to 4 launchable planes for recon could spot a submarine at 200 feet or more depending on water conditions, and either attack with bombs or direct surface warships to the target. This hasn't changed, only improved. Today's ASW aircraft comprise both Helo's and long range fixed wing aircraft (e.g., P-3 Orion) that can drop sonobuoys that have both active and passive sonar to find a submerged target. They are also outfitted with, and can launch torpedoes when they find one.
However, much has changed in submarine technology today since WWII. Back then, submarines were extremely limited in their ability to remain submerged for very long. With the advent of Nuclear Power and improved battery technology for Diesel Boats today, the ASW advantage is in the submarine's ballpark. The inherent quietness of modern boats, combined with the ability to use the ocean's many environmental hiding places, makes it difficult at best for ships, planes and helo's to find a submarine. In fact, the best detection device for finding a submarine is another submarine.
Asdic
In Britain, ASDIC.In America SONAR.Different names for the same thing!
ASDIC stands for Anti-Submarine Detection Investigation Committee. It was a British military project during World War II that developed sonar technology for detecting submarines.
The Royal Navy had Asdic for submarine detection. Initially it was quite primitive. I'm thinking Sonar, as such, is more recent than WW2.
Virginia class submarine
England had the most powerful surface fleet of ships, while Germany had the most powerful submarine fleet. England's surface fleet won out over German submarines.
David Bushnell launched what is regarded as the world's first submarine.
The world's first atomic powered submarine was the USS Nautilus.
The USS Nautilus (SSN-571) was the world's first operational nuclear submarine.
World War II submarines were powered by large electric motors. On the surface, the motors drew their power from diesel generators, not unlike how a diesel locomotive operates today. When submerged, the diesel engines could not be operated, and the motors drew their power from huge banks of electric batteries. After the batteries were drained of their power, the submarine would have to surface in order to run its diesel generators to provide propulsion and electric power to the submarine. During this period, the sub's batteries were recharged. Toward the end of World War II the submarine snorkel was invented, which gave a submarine the capability of running its diesel engines while submerged. The submarine was required to stay relatively close to the surface, but it was fully submerged with the exception of the snorkel mast. Nuclear powered submarines also have banks of electric batteries, but they are only used when the main propulsion plant and/or its steam-powered electric generators are disabled. When a nuclear-powered submarine's batteries are fully drained, they are recharged by the boat's diesel generator if its steam-powered electric generators are not available, or by the steam-powered electric generators when they becomes available. Just like a diesel-electric submarine, a nuclear-powered submarine must operate its diesel generator on or near the ocean's surface.
Radar : radio detection and ranging .
A U-boat was a submarine used by Germany in World War 1 and World War 2.