Kubernate

Java 8 # Sort all the value present in ArrayList

import java.util.*;
import java.util.stream.*;
public class SortValues {
public static void main(String[] args) {
List<Integer> myList = Arrays.asList(100, 2, 3, 4, 5, 6, 7, 8, 9, 10);
myList.stream().sorted(Integer::compareTo).forEach(System.out::println);
}
}

No comments:

Post a Comment

Spring Boot - Bean LifeCycle

 Here is a clear, step-by-step lifecycle of a Spring Boot application , explained in a simple + interview-ready way. 🔄 Spring Boot Applica...

Kubernate