More than one thousand submarines and tens of thousands of their crews went to the bottom in World War 2. It’s obvious that submarines are obsolete.
One day the technology will exist that underwater drones will find and sink without warning any submarine, anywhere. Then indeed submarines will be outmoded. Technology advances have always defined how and with what wars are fought. It will continually evolve.