Java: How to Find the Minimum Value from a Random Array by Bubble Sort Method

public class HelloWorld{
  public static void main(String[] args){
	  int[] a = new int[5];
      a[0] = (int) (Math.random() * 100);
      a[1] = (int) (Math.random() * 100);
      a[2] = (int) (Math.random() * 100);
      a[3] = (int) (Math.random() * 100);
      a[4] = (int) (Math.random() * 100);
       
      System.out.println("The individual random numbers in the array are :");
      for (int i = 0; i < a.length; i++)
          System.out.println(a[i]);
       
      System.out.println("bubble sorting method: (compare two by two, put the bigger one behind)");
      for (int j = 0; j < a.length; j++) {
          for (int i = 0; i < a.length-j-1; i++) {
              if(a[i]>a[i+1]){  
                  int temp = a[i];
                  a[i] = a[i+1];
                  a[i+1] = temp;
              }
          }
      }
      System.out.println("the minimum number is"+a[0]);
  }
}

Read More: