Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Norm

Thread: Storing random numbers into a String field

  1. #1
    ajw1993 is offline Member
    Join Date
    Nov 2012
    Posts
    30
    Rep Power
    0

    Default Storing random numbers into a String field

    Hello
    I want to be able to store random numbers into a string field with a string , i have created the method , but everytime it runs it only stores one number , how can i do it to store all the numbers generated

    public void generatorRandom(String o , int p)
    {
    int number;
    Random l = new Random ();
    for (int k=0; k<p; k++)

    {
    number = l.nextInt(10);


    customerID = o + number;


    }

    }

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,518
    Rep Power
    25

    Default Re: Storing random numbers into a String field

    DarrylBurke likes this.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. I need help storing numbers in loops
    By MrPosotive in forum New To Java
    Replies: 26
    Last Post: 10-10-2012, 05:55 AM
  2. help w/ storing/scanning numbers in arrays
    By clemsontigers in forum New To Java
    Replies: 2
    Last Post: 03-30-2011, 06:46 AM
  3. help w/ storing/scanning numbers in arrays
    By clemsontigers in forum New To Java
    Replies: 15
    Last Post: 11-18-2010, 05:12 AM
  4. Replies: 8
    Last Post: 04-19-2009, 05:50 PM
  5. random numbers without random class`
    By carlos123 in forum New To Java
    Replies: 4
    Last Post: 01-17-2008, 10:44 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
  •