Do you know what happens to a ship when it’s too old to sail anymore?

The average lifespan of a ship is 25-30 years. After this span, the ship may become too expensive to operate, but most importantly, to become unseaworthy putting human safety at risk. So, have you ever wondered what happens to a ship when it is too old to sail?