For the phone number: 234-567-8901, I would name variables like:
areaCode = "234";
exchange = "567";
What would an appropriate variable name be for "8901"?
For the phone number: 234-567-8901, I would name variables like:
areaCode = "234";
exchange = "567";
What would an appropriate variable name be for "8901"?
There is a large Wikipedia article (http://en.wikipedia.org/wiki/Phone%5Fnumber) that gives a lot of history but no clear term for this part of the number. It may, in some cases, be a subscriber number and in some cases an extension.
Depends on why you're doing it.
Personally I'd go for "line". But "personal", "specific", "individual" "final" and "local" would all make sense.
Unless the software is to be used inside a telecommunications company (who would know the correct term), I would go for readability over technical correctness.
Since there is no consensus on the exact term or at least a commonly used name, I would choose something like "fourDigits" over a technically correct term "line number", "extension", "suffix", or "Subscriber line number (SLN)."