A submarine is a specialized underwater watercraft used for military purposes, capable of controlling its buoyancy to dive and surface. It is constructed with a pressure hull and ballast tanks, enabling operations such as diving, surfacing, and steering with the help of hydroplanes and engines powered by either diesel-electric systems or nuclear reactors. Submarines also include life support systems for air quality and fresh water production, navigational equipment, and torpedoes for defense.