Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

import java.util.Arrays;

import java.util.Comparator;

public class Main {
    public static File[] dirListByDescendingDate(File[] files) {
        Arrays.sort(files, new Comparator() {
            public int compare(final Object o1, final Object o2) {
                return new Long(((File) o2).lastModified()).compareTo(new Long(((File) o1).lastModified()));
            }
        });
        return files;
    }
}