Results 1 to 2 of 2

Thread: Class random

  1. #1
    765891 is offline Member
    Join Date
    Jan 2013
    Rep Power

    Wink Class random

    Hello All,
    I was wondering if the number entered between the parenthesis of the nextInt is inclusive or exclusive, since it starts are 1 and I wasn't sure if the number entered was inclusive or exclusive.
    Java Code:
    import java.util.*;
    public class GuessingGame
        public static void main(String[] args) 
            Random rn = new Random();
            Scanner in=new Scanner(;
            int randomNum=rn.nextInt(100);
    Thank you

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    New Zealand
    Rep Power

    Default Re: Class random

    The place to go to for that is the API documentation. They're well worth bookmarking.

Similar Threads

  1. Random Class
    By dougie1809 in forum New To Java
    Replies: 5
    Last Post: 01-20-2012, 01:37 AM
  2. Using the random class
    By schmitty514 in forum New To Java
    Replies: 6
    Last Post: 04-26-2010, 03:56 AM
  3. Replies: 14
    Last Post: 10-19-2009, 10:57 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

Tags for this Thread

Posting Permissions

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