Why are Ships Referred to as She?

Many sailors refer to their ships as she, according to the name of the ship. There is no special part that determines a ship’s gender, just the preference of the owner!