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

_____ are pieces of information that support the main idea.
Match the following real numbers with the proper combination of number types on the right. 1. rational, integer, whole, counting, or natural 2. rational,
A collection of pitches arranged in ascending and descending order constitutes a:
why do you think the Confederacy decided to fire on Fort Sumter rather than accept Lincoln's request to peacefully resupply the soldiers there?
When a company pays utilities of $1,720 in cash, the transaction is recorded as:?
In certain plants, red flowers are dominant to white flowers. if a heterozygous plant is crossed with a homozygous red-flowered plant, what is the probability t
Insects are responsible for the destruction of a significant percentage of potential food harvests every year.
Can some on please compare and contrast the independence movements of Canada, Australia, and New Zealand.
What is meant by"survival of the fittest" when referring to natural selection
Which careers require a person to find independence in working alone? Visual Arts A/V Technology Printing Technology Performing Arts