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);
}
}
Kubernate
Java 8 # Sort all the value present in ArrayList
Subscribe to:
Comments (Atom)
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
-
Features in Java 8 Key Features in Java 8 Lambda Expressions Functional Interfaces Streams API Optional Cl...
-
Java throw and throws Keywords Introduction The throw and throws keywords in Java are used to handle exceptions. They play a c...
-
Java Enums Introduction Enums in Java provide a way to define a set of named constants. They are used to represent a fixed set of valu...
No comments:
Post a Comment