vérifier ordre alphabétique java code example
Example: trier par ordre alphabétique java
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class StringSorter {
public static void main(String[] args) {
List namesList = new ArrayList();
namesList.add("Top language");
namesList.add("Happy programming !");
namesList.add("Java");
namesList.add("HackTrack");
Collections.sort(namesList);
System.out.println(namesList);