You can copy and paste this into Netbeans to practice coding Bubblesort. All that is required is the implementation of the sort() method.
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package bubblesort; /** * * @author kobzaje */ public class BubbleSortMain { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here BubbleSort bs = new BubbleSort(); bs.sort(); bs.print(); } } class BubbleSort { int[] array = {7, 3, 8, 2, 1, 6, 4, 5}; void sort() { // DO THIS BIT } void print() { for(int i = 0; i<array.length; i++){ System.out.print(array[i] + " "); } System.out.println(); } }