Results 1 to 2 of 2
  1. #1
    new12java is offline Member
    Join Date
    Apr 2012
    Posts
    1
    Rep Power
    0

    Default Adding random numbers questions

    This is the first time I'm learning java and I've an assignment to generate two random numbers and to ask the user to add these two numbers. After that, use a try/catch to assure the user inputs a number.

    How do I go about doing it? I'm really confused with the Math.random and Random.

    Thanks.

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

    Default Re: Adding random numbers questions

    Have you read the API documentation for the Math.random() method and the Random class? All the details are explained there.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 26
    Last Post: 10-30-2011, 07:01 AM
  2. Replies: 8
    Last Post: 04-19-2009, 06:50 PM
  3. Random numbers
    By jithan in forum Advanced Java
    Replies: 3
    Last Post: 06-14-2008, 03:04 PM
  4. random numbers without random class`
    By carlos123 in forum New To Java
    Replies: 4
    Last Post: 01-17-2008, 11:44 PM
  5. random numbers
    By carlos123 in forum New To Java
    Replies: 1
    Last Post: 12-22-2007, 03:56 AM

Posting Permissions

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