CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Bubble Sort
public class SortByName implements Sortable {
    
    @Override
    public File[] sort(File[] files) {
        File aux;
        
        for (int i = files.length; i >= 1; i--) {
            for (int j = 1; j < i; j++) {
                if (files[j] != null && 
                        files[j - 1].getName().compareTo(files[j].getName()) > 0) {
by Licínio Mendes   May 31, 2011 @ 6:32am
101 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate