You are not logged in.
Pages:: 1
#1 2015-06-16 05:34:51
Random Integer:
Java Quizzes Java Language Constructors-And-Methods
Question:
Which of the following options is the best for generating random integer 0 or 1?
Option A):
(int)(Math.random() + 0.2)
Option B):
(int)(Math.random() + 0.5)
Option C):
(int)Math.random() + 1
Option D):
(int)Math.random()
Correct Answer is Option B):
(int)(Math.random() + 0.5)
You cannot discover the new oceans unless you have the courage to lose the sight of the shore.
Offline
2015-06-16 05:34:51
- Advertisement
- Ads By Google
Re: Random Integer:
\n
Pages:: 1