Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    public static void main(String[] args) {
        double number = Math.random();
        System.out.println("Generated number: " + number);

        number = Math.random() * 10;
        System.out.println("Generated number: " + number);

        number = 100 + (Math.random() * 100);
        System.out.println("Generated number: " + number);

        int random = 100 + (int) (Math.random() * 100);
        System.out.println("Generated number: " + random);
    }
}