Always depends on the angles and numbers coming at you often in conjunction with other asymmetrical ordinance.
Sorry but once a surface capital ship is located. ( and there are many ways to locate and pinpoint track), a junior rating sitting in front of a console in a bunker outside of Shanghai can sink that ship as if he was playing a video game. In fact video game champions will be the new marksmen in any future war.
The encouraging news is that the Navy is working on a laser based defense system. If enough power can be put on the target fast enough and long enough, it will also be capable of destroying inbound attacks.
And so continues the cycle of attack and defense.