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

In your own words, describe an interaction between the cryosphere and the hydrosphere.
frunze de dor un poem al dragostei visate urgent
PART 3 Please answer both questions with 100% certainty and if you don't know one but you know the other then post your answer in the comments. I will award the
What is the water rainy percussion called?
Damon’s car can go an average of 18 miles on each gallon of gas. If m represents the number of miles, which equation models this situation? CLEAR CHECK m = 11
Which state contributes to almost one third of mexico freshwater resources?
1. Directions: Type the correct answer in each box. Use numerals instead of words. In the right triangle shown below a = 2b + 4 and all side lengths are inte
Fill in the blank with >,<, or = : 4.82 ___ 6.1
Who would be allowed to vote in a Democratic Party closed primary
Stem-changing (boot) verbs do NOT have stem changes in the __________ forms. Ustedes & ellos Nosotros & vosotros Yo & tú Él & ella