Q. Which method in java is used to generate random numbers in Java?

  • (A) random.nextInt()
  • (B) random()
  • (C) rand()
  • (D) All of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) random.nextInt()
Explanation: The Java method random.nextInt() is used to generate random numbers.
Explanation by: Team MCQ Buddy
The Java method random.nextInt() is used to generate random numbers.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
349
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
82%
Success Rate