Constructing a random number generator

Report a typo

You've been given several lines of a Java program that are out of order. Your task is to reorder the lines to create a functioning program which generates and prints a random number between 0 and 100. Keep in mind that this task involves the application of standard classes for computations.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                }
              
                }
              
                public static void main(String[] args) {
              
                import java.util.Random;
              
                public class Main {
              
                Random rand = new Random();
              
                System.out.println("Random number between 0 and 100: " + randomNum);
              
                int randomNum = rand.nextInt(100);
              

Create a free account to access the full topic