Results 1 to 4 of 4
  1. #1
    zerwik is offline Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    3
    Rep Power
    0

    Default Random number generator

    I'm building a throw dice procedure for which I copied the code exactly from a popular online tutorial (you have heard of it). I can import the lib, import java.util.Random;, and finish the rest of the code and I get an error. Something like, Random can't be used here plus a lot of junk pointing to variable.nextInt (6);. I'm guessing the random library isn't being imported.

    I put it down for a while and later it was working. I checked the spelling so it was not possibly a typo. Things like that happen. Not a big deal< I know.

    Btw, Java is cool.

  2. #2
    Fortu is offline Member
    Join Date
    Dec 2010
    Posts
    57
    Rep Power
    0

    Default

    Is there still a problem, or have you found a solution?

  3. #3
    zerwik is offline Member
    Join Date
    Dec 2010
    Location
    Indiana
    Posts
    3
    Rep Power
    0

    Default

    Yeah, nothing much going on...

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by zerwik View Post
    I'm building a throw dice procedure for which I copied the code exactly from a popular online tutorial (you have heard of it). I can import the lib, import java.util.Random;, and finish the rest of the code and I get an error. Something like, Random can't be used here plus a lot of junk pointing to variable.nextInt (6);. I'm guessing the random library isn't being imported.
    It might've been junk to you but it would've been nicer if you'd shown us your code plus that 'junk' produced by the compiler.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Random Generator
    By Learning Java in forum New To Java
    Replies: 9
    Last Post: 05-31-2010, 09:15 PM
  2. Random number generator
    By Michailangelo in forum Advanced Java
    Replies: 4
    Last Post: 04-02-2010, 07:47 PM
  3. Help with class project, random number generator.
    By Christopher The Great in forum New To Java
    Replies: 4
    Last Post: 03-14-2009, 03:12 AM
  4. Random Shape generator
    By scheng12 in forum New To Java
    Replies: 1
    Last Post: 03-09-2009, 03:06 AM
  5. Random Generator
    By padutch2 in forum New To Java
    Replies: 1
    Last Post: 12-03-2007, 07:43 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
  •