Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Generate random numbers using Java! 🔀
Play lesson

Java tutorial for beginners ☕ - Generate random numbers using Java! 🔀

5.0 (4)
40 learners

What you'll learn

This course includes

  • 12 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

#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"); } } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere