Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

public class Main {
    public static void main(String... args) {
        List<String> names2 = Arrays.asList("XML", null, "Java", "HTML", "CSS");
        names2.sort(Comparator.nullsFirst(String::compareTo));
        System.out.println(names2);

    }
}