Q:

How do you control a range for type safety?

Imagine you have a function that converts ints to roman string:
public String roman(int)

Only numbers from 1 to 3999 (inclusive) are valid for conversion. 
So what do you do if someone passes 4000 in any OO language?

raise an exception
return “” or some other special string
write an assert
…

A:

Number 1: raise an exception. That's what ArgumentOutOfRangeException is for (at least in .NET):
if (intToConvert >= 4000)
{
    throw new ArgumentOutOfRangeException("intToConvert ", "Only numbers 1-3000 are valid for conversion.");
}

