There is a great novel by Max Brooks called World War Z that contemplates this very issue. It is actually a very interesting topic because zombie warfare is different from any other that mankind has ever faced. Zombies are not afraid, do not rest, do not stop, and never show mercy.
That's ridiculous. Armies have faced plenty of enemies that were just like that, to a close approximation.
And, they used to be us. So when fighting them, some of our losses turn into zombies, and we are faced with the horrifying dilemma of whether or not to put them out of their misery before they turn into more enemy.
Yeah, we'd be faced with that decision just long enough for everybody who worries about that question to be weeded out of our army.
In World War Z, zombies could not swim, but they could walk the Ocean Floor. So droves of them would just show up on beaches and climb anchor lines.
That's ridiculous, too. Humans are less dense than water, especially sea water, and only get less dense after death. Also have you ever tried walking on the ocean floor? Zombies would be worse than "shamblers" at this. And climbing up the anchor line is really not a concern. Everybody knows the best place to deal with zombies is at a bottleneck, which will bring me to my last point.
All of this talk about various guns to be used against zombies is, with all due respect, myopic at best. Facing zombies with guns the question you have to ask yourself is, "Will it jam before it runs out of bullets?"
Proper zombie defense preparation includes edged-weapon training. I presume all sailors will still keep a full-time watch, even at anchor, and nothing passes the time like hacking off the arms of zombies as they try to climb up your anchor rode.
Though I guess for full disclosure I should reveal that I'm a swordfighting instructor