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

    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.


  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power

    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,

    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Replies: 26
    Last Post: 10-30-2011, 06:01 AM
  2. Replies: 8
    Last Post: 04-19-2009, 05:50 PM
  3. Random numbers
    By jithan in forum Advanced Java
    Replies: 3
    Last Post: 06-14-2008, 02:04 PM
  4. random numbers without random class`
    By carlos123 in forum New To Java
    Replies: 4
    Last Post: 01-17-2008, 10:44 PM
  5. random numbers
    By carlos123 in forum New To Java
    Replies: 1
    Last Post: 12-22-2007, 02: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