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

Cancerous cells may continuously change their glycocalyx. this may result in
(02.04 HC)List an example of how an ecosystem can be affected by weather patterns. Explain how ocean temperatures affect weather patterns.
How many electrons does the predictable (most common) ion of calcium contain?
Trevor is going to Debra's Steakhouse and really wants filet for dinner and creme brulee for dessert. He knows that the probability of getting a filet at Debra'
Can someone pls help me??
A Hummingbird moves its wings at a rate of 5520 wingsbeats a minute. Write this rate in wingbeats per second?
Of the 8760 hours in a​ year, one television was on for2628hours. what percent is​ this?
Memories can often be triggered by an associated environmental stimulus. this process is called _____.
The ____________ _______ is that memory is better when we generate associations to ourselves than when we simply read about associations to other things.
A constant is a value in a formula that doesn't change. _______________