Check out example codes for "what is natural order in java". It will help you in understanding the concepts better.

Code Example 1

// Java program to demonstrate 
// Comparator.naturalOrder()  method 
import java.util.Arrays; 
import java.util.Comparator; 
import java.util.List; 
public class GFG { 
    public static void main(String... args) 
        List<Integer> values 
            = Arrays.asList(212, 324, 
                            435, 566, 
                            133, 100, 121); 
        // naturalOrder is a static method 
        // print sorted number based on natural order 

Learn ReactJs, React Native from