Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

sorting collections with comparator java


Collections.sort(marvel, new Comparator<String>() {
            @Override
            public int compare(String hero1, String hero2) {
                return hero1.compareTo(hero2);
            }
        });
Source by www.infoworld.com #
 
PREVIOUS NEXT
Tagged: #sorting #collections #comparator #java
ADD COMMENT
Topic
Name
3+4 =