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

On a roadtrip a family drives 350 miles per day. how many days, d must they travel to reach a distance of atleast 1,400 miles write an inequality to represent t
A cue ball of mass ml 0.365 kg is shot at another billiard ball, with mass m2 055 kg, which is at rest. The cue ball has an initial speed of v = 8.5 m/s in the
You’re given side AB with a length of 6 centimeters and side BC with a length of 5 centimeters. The measure of angle A is 30°. How many triangles can you constr
Kelly went on vacation to the Hamptons. She was curious about whether rich people own a lot of TVs, so she went door to door in 333 neighborhoods, asking people
What is the slope of the line that passes through points (2,1) and (17, -17) write your answer in simplest form
f(x)=6x^2+10x-1 What is the value of the discriminant of f? How many distinct real number zeros does f have?
PLZ HELP! Will give BRAINLIEST!
misconceptions people might have use of medicines ​
please help will make brainliest!
The process in which light travels through an object is called