-
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());
}
}
-
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.
-
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.