Is there a data type I can use to store a single digit, but nothing else. i.e. one of 0 – 9 and nothing else.
I know I could use short, int or long, but it’s for the design of an api and I want to be clear that the user should only give me a single digit.
Sounds like a good candidate for an enum type.
Benefits:
Disadvantage: