1.

Which method is used to generate boolean random values in java?(a) nextBoolean()(b) randomBoolean()(c) previousBoolean()(d) generateBoolean()This question was posed to me in an interview for job.My question is taken from Random Number in chapter java.util – More Utility Classes of Java

Answer»

The correct OPTION is (a) nextBoolean()

For explanation I WOULD say: nextBoolean() method of java.util.Random CLASS is USED to GENERATE random numbers.



Discussion

No Comment Found

Related InterviewSolutions