answersLogoWhite

0

How to you hold a random number for next deal in java?

Updated: 8/20/2019
User Avatar

Wiki User

11y ago

Best Answer

Random numbers can be generated using the Math.random() function. For example, the following statements is used to create a random number 0 and 34.

int random= (int)(Math.random()*34);

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How to you hold a random number for next deal in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a BINGO card using Java 3.0 that when you run again the number in the bingo card will not be seen again..it would be in random?

I don't know about Java 3.0 but with the current version of Java 5.0 The Random class could be used or the Math.random() method (which really uses the Random class). The way I would approach this after getting the random number generator down is to make a class to be the Bingo Card, perhaps implemented with an instance of a 2D Array (an Array of Arrays) to hold each number, perhaps a 2D array to hold whether each box is stamped, and a method to check whether I have a bingo. If you have questions about 2D Arrays and how to manipulate them check out the link below.


How can random numbers be generated in Java?

Random numbers can be generated in Java using the "random" class. One needs a single "random" object to generate a series of random numbers as a unit.


What is a random number and how are generated?

Random numbers that are generated by a computer are pseudo-random (not really random), but they will pass enough statistical tests for randomness to be useful in simulation random processes. Java has random number generators in the standard libraries. See the related link if you need more information.


What does mathrandom return in java language?

Math.random() will return a pseudo-random number in the range [0.0, 1.0)


How good is java random number generator?

I don't what you mean by good, but I have tested it and it creates a normal distribution also known as Gaussian.


What does it mean to generate random numbers in Java?

Generating random numbers in Java is somewhat of a misnomer because the numbers are actually semi-random.It means to use the program to obtain random integers to use in hypothetical situations such as statistics.


What is Java and are updates needed?

Java is a programming language.In IT sector there is a demand of change always so to overcome and deal with the demand there is a need of updating of java.


Could you write a java program that randomly generate a number plate for a car registration using the random method from Maths class eg NLF810?

yes, use for loop;;


Why java has been given that name?

Java was basically a random name yelled out during a marketing meeting. See the related link for an e-mail about this from James Gosling.


What is abbreviation of java?

Java does not stand for anything. Java is a programming language created by James Gosling and now developed by Sun Microsystems. The name was chosen at random. It may have something to do with staying awake late a night?


In Java method usually hold the properties of an object. True or False?

true


How write a java program to generate random numbers in between 0-100 and print only the odd numbers?

Use a pseudo-random number generator to produce random integers. To determine if a given integer is odd or even, use the following functions: bool is_odd (int x) { return x%2; } bool is_even (int x) { return !is_odd (x); }