I cant find an effective way to format the inside of the array to one decimal place.
Then there is a issue with the stopwatch I have towards the end of the code to keep track of how long it takes for the bubble sort to process based on the array size.
import java.util.Arrays;
import java.util.Random;
public class BubbleSortTest {
    public static void sort(double arr[]) {
        int arrayLength = arr.length;
        for (int i = 0; i < arrayLength-1; i++) {
            for (int j = 0; j < arrayLength-i-1; j++) {
                if (arr[j] > arr[j+1]) {
                    //swap temp and arr[i]
                    double temp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = temp;
                }
            }
        }
    }
/* Prints the array */
public static void printArray(double arr[]) {
    int arrayLength = arr.length;
    for (int i = 0; i < arrayLength; ++i) {
        System.out.print(arr[i] + " ");
    }
    System.out.println();
}
public static void generateDoubleArray(double arr[], int length) {
    //generating random values
    Random rand = new Random();
    for(int i = 0; i < length; i++) {
        arr[i] = (rand.nextDouble() * (100 - 0)) + 0;
    }
}
public static void main(String args[]) {
    BubbleSortTest ob = new BubbleSortTest();
    int length = 3; //change the length according to requirement
    double arr[] = new double[length]; // Ex) {6.1, 4.2, 3.3, 7.4, 5.5, 2.6, 8.7, 1.8};
    BubbleSortTest.generateDoubleArray(arr, length);
    System.out.println("BEFORE BUBBLE SORT: "+ Arrays.toString(arr));
    BubbleSortTest.sort(arr);
    System.out.println("AFTER BUBBLE SORT: "+ Arrays.toString(arr));
    StopWatch s = new StopWatch();
    double[] a;
    for(int i = 1; i <= 10; i++) {
        a = BubbleSortTest.generateDoubleArray(i * 20000, i*30000);
        s.start();
        sort(a);
        s.stop();
        System.out.println("Size: " + i*1000 + "\t\tTime: " +s.elapsedTime());
    }
}
   // Size: 1000        Time: 0.0
   // Size: 2000        Time: 0.0
   // Size: 3000        Time: 0.0
   // Size: 4000        Time: 0.0
   // Size: 5000        Time: 0.0
   // Size: 6000        Time: 0.0
   // Size: 7000        Time: 0.0
   // Size: 8000        Time: 0.0
   // Size: 9000        Time: 0.0
   // Size: 10000       Time: 0.0
 // Output with length of array = 3 
 // BEFORE BUBBLE SORT: [56.24793454034215, 1.3614871074902335,17.853054450932547]
  //AFTER BUBBLE SORT: [1.3614871074902335,17.853054450932547,56.24793454034215]