Henry Wong wrote:
Be careful here... Your "home" and "cell" phone parameters take an int value. "555-412-0432" is not an integer value -- it is an integer expression. Basically, Java will evaluate it to "555 minus 412 minus the value of 0432 (converted from octal to decimal)" and use the result of that.
Henry
I would like to suggest that unless the variable is going to be used in a mathematical expression of some kind, declare it as
string.
Even if the OP did not include the dashes in the phone number, I'd still declare it a String, because it will never be included in any kind of mathematical expressions. Maybe this is just a question of style, you can make it work either way.