Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Random;

public class Main {

    public static void main(String[] args) {
        int[] a = new int[10];

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;

        for (int b = 0; b < a.length; b++) {
            a[b] = new Random().nextInt(100);
        }

        for (int b = 0; b < a.length; b++) {
            if (a[b] < min)
                min = a[b];
            if (a[b] > max)
                max = a[b];
        }
        System.out.println("Min is: " + min + " " + "Max is: " + max);
    }
}