Ask Question
22 March, 17:36

What is the output from system. out. println ((int) (math. random () * 4)) ?

+3
Answers (1)
  1. 22 March, 20:51
    0
    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.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “What is the output from system. out. println ((int) (math. random () * 4)) ? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers