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 of the following sound devices can create euphony in a poem? (Select all that apply.) dissonance alliteration assonance consonance
An example of a Freudian Slip would be: A.naming your pet dog Tuna because tuna fish is your favorite food B.leaving for a date and telling your parents you won
which if the following statements accurately describes the phases of the menstrual cycle in humans
Which represents a metabolic process?
The process by which oxygen and carbon dioxide are exchanged between cells blood and air is called
The major environmental issues in Central America, South America, and the Caribbean include all the following except _____.
What is the purpose of the declaration of independence stated in the introductory paragraph?
Study the image above. Which of the following names should you place on the line labeled "C"? Executive Legislative Judicial Supremacy
Which represents a metabolic process?
Find the point, M, that divides segment AB into a ratio of 5:6 if A is at (0, 22) and B is at (11, 0). A) (5, 12) B) (5, 11) C) (6, 12) D) (6, 11)