Results 1 to 3 of 3
  1. #1
    herolua is offline Member
    Join Date
    May 2011
    Posts
    6
    Rep Power
    0

    Default Help about String !!!

    String snumber = Long.toString(n);
    String mask = "0000000";

    DecimalFormat dec = new DecimalFormat(mask);
    snumber = dec.format(n);

    what does it mean ?

    import java.text.DecimalFormat; --> what ?
    Last edited by herolua; 10-07-2011 at 06:39 PM.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: Help about String !!!

    What does what mean? We aren't here to translate java code for you. If you are unsure about how some code you found works, check the API documentation

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default Re: Help about String !!!

    In general, the import statement is used to import already existing classes in Java, into your program so that you can use them in your program.

    So without the import statement (import java.text.DecimalFormat), you wouldn't be able to use the Decimal Format class as you are in your code.

Similar Threads

  1. Replies: 11
    Last Post: 08-15-2011, 10:12 AM
  2. Replies: 12
    Last Post: 11-26-2010, 08:33 AM
  3. Replies: 1
    Last Post: 11-04-2010, 06:53 PM
  4. Replies: 5
    Last Post: 01-11-2009, 10:12 AM
  5. Replies: 0
    Last Post: 11-20-2007, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •