|
-
Jul 4th, 2007, 08:08 AM
#1
Thread Starter
Member
problem data type
hi thnake for reply i did declare the phone number as number dosen't work if insrting the 01992 but work with +1992, my question how to insert phon number started with 0.
Code:
public class Test
{
public static void main(String args[])
{
CustomerDetails customer = new CustomerDetails (2,"omar","sun","n3 6hr",+1992787878);
System.out.println("Custer Details is \t" + customer.getCustomerId() +" "+ "House Number is"+ " "+customer.getHouseNumber()+ " "+ customer.getStreetName()+" "+customer.getTelephoneNo());
}
}
-
Jul 4th, 2007, 09:59 AM
#2
Frenzied Member
Re: problem data type
Change the CustomerDetails' last constructor argument to a String. You can do more with a phone number modeled in a String rather than modeled in a long or some arithmetic type.
-
Jul 4th, 2007, 09:51 PM
#3
PowerPoster
Re: problem data type
String is supporting for any type, as you ask "0,/?'l[]99po0-=2" is a String. Just use it, so simple, so valid for phone numbers.
“victory breeds hatred, the defeated live in pain; happily the peaceful live giving up victory and defeat” - Gautama Buddha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|