karleebernese1817 karleebernese1817
  • 24-02-2018
  • Computers and Technology
contestada

What is the output from system.out.println((int)(math.random() * 4))?

Respuesta :

pbzepplin
pbzepplin pbzepplin
  • 09-03-2018
In java, the math.random() function call will return a random number between 0 and 1. Therefore, the call 'math.random() * 4' will return a number between 0 and 4. The casting of this call to an integer '(int)' will return an integer with no fraction, so numbers 0, 1, 2, 3 or 4.
Answer Link

Otras preguntas

Which sentence uses commas correctly?  A.Theo, is there a bug on my back?  B.Please Beth, feed the goldfish.  C.I wonder, Mike if everyone has already left.  D.
Give the details of clothes
Is -12 a integer, rational number, irrational or a whole number?
371.616 the 1 in the ones place is _____ the value of 1 in the hundredths place
Important substances found in food, which promote growth and good health
24 divided by -5 = -4.8. How do you get the .8? I know 5 goes into 20 4 times so the answer is -4.8, but I don't know the step of how to get the .8 without usin
you are making curtains by alternating strips of solid colored fabric and patterned fabric. the solid colored fabric costs 99¢ per strip and the patterned fabri
what is 3.2 x 10^-4 m/h in centimeters per second?
During February, Kevin will water his ivy every third day, and water his cactus every fifth day. On which date will Kevin first water BOTH plants together?
How did neolithic people conduct trade?