User:Andrewemo

Sorting an Arrays Using Bubble Sort Arrays.sort.

import java.util.*; import javax.swing.*;

public class BubbleSortAlgorithm { public static void main(String args[]){ int [] names = new int [5]; for(int x=0;x<names.length;x++){ int xx = Integer.parseInt(JOptionPane.showInputDialog("Enter " + names.length+ " Digit")); names[x] = xx;} Arrays.sort(names); JOptionPane.showMessageDialog(null,Arrays.toString(names));}}