What does "stateroom" mean?

Stateroom: A small apartment for lodging or sleeping in the cabin, or on the deck, of a vessel; also, a somewhat similar apartment in a railway sleeping car.

Sources