Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6626515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:54:05+00:00 2026-05-25T21:54:05+00:00

For my specific purposes, I need to generate a whole number between 1 and

  • 0

For my specific purposes, I need to generate a whole number between 1 and 120 inclusive (which I can do no problem).

Once that number has been generated, I need to pull it from the pool so it can’t be generated again.

Continue this process until all numbers are exhausted, at which point, the pool fills back up and we start over again.

How could I go about doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:54:06+00:00Added an answer on May 25, 2026 at 9:54 pm

    Generate the whole list of numbers from 1 to 120. Shuffle the list. Take the first element (and remove it)

    List<Integer> list = new LinkedList<Integer>();
    for (int i = 1; i <= 120; i++) {
        list.add(i)
    }
    Collections.shuffle(list);
    ...
    int random = list.remove(0);
    ...
    int otherRandom = list.remove(0);
    

    Check for list.empty() in case you run out of numbers. If empty, create the list again and shuffle it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My specific problem is that I need to execute a (potentially) large number of
for testing purposes, I need to override a specific method call, which is currently
For my purposes, I need to search for a specific node in an xml
For testing purposes, I need to find two 64-bit integer values that exactly multiply
Background I'm working on an internal project that basically can generate a video on
In Android applications, what is the best strategy to generate reports that can be
It is my opinion that every language was created for a specific purpose. What
A specific page in my web application has a URL www.example.com/Test/Index However, I want
Is there a way to print only specific pages in jasper. I need it
I need a model for finding all of the regular expressions that would match

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.