Results 1 to 3 of 3

Thread: problem data type

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2007
    Posts
    39

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

  2. #2
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    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.

  3. #3
    PowerPoster eranga262154's Avatar
    Join Date
    Jun 2006
    Posts
    2,201

    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
  •  



Click Here to Expand Forum to Full Width