tubeshowcase●1,194,391 videos♡ My collection 0
← Learn to Code

Learn to Code05:01

Generate random numbers using Java! 🔀

Bro Code ↗

From the creator

#java #javatutorial #javacourse import java.util.Random; public class Main { public static void main(String[] args) { Random random = new Random(); int number; boolean isHeads; number = random.nextInt(1, 7); isHeads = random.nextBoolean(); System.out.println(number); if(isHeads){ System.out.println("HEADS"); } else{ System.out.println("TAILS"); } } }

Published 2024-12-05 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.

Keep exploring Learn to Code