The following is a sample code for implementing bubble sort in Java language:
public class BubbleSort {
public static void main(String[] args) {
int[] arr = {
5, 2, 8, 3, 9, 1};
bubbleSort(arr);
System.out.println(Arrays.toString(arr));
}
public static void bubbleSort(int[] arr) {
int n = arr.len