I have to write a class that has a natural number taking values only in the (0, 15] range.
I can easily do some checking logic in the setter/constructor for that field - but is there any pre-defined data type which can achieve this behavior?
I have to write a class that has a natural number taking values only in the (0, 15] range.
I can easily do some checking logic in the setter/constructor for that field - but is there any pre-defined data type which can achieve this behavior?