what is the output.. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

what is the output..

Random rand = new Random(); int x = rand.nextInt(3): System.out.print(x);

15th Jul 2018, 3:24 PM
Nitin bahekar
Nitin bahekar - avatar
1 Réponse
+ 23
The output is random. "x" may be 0, 1 or 2.
15th Jul 2018, 3:35 PM
Igor Makarsky
Igor Makarsky - avatar