package com.sxt; import java.util.Arrays; public class BubbleSort { public static void main(String[] args) { int[] arr={83,3,70,33,2,-99}; for(int i=0;i<arr.length;i++){ for(int j=0;j<arr.length-i-1;j++){ if(arr[j]>arr[j+1]){ swap(arr[j],arr[j+1]]); } } System.out.println(Arrays.toString(arr)); } } }