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:
Posts (Atom)
OpenAI Agent SDK
OpenAI Agents SDK
Kubernate
-
Features in Java 8 Key Features in Java 8 Lambda Expressions Functional Interfaces Streams API Optional Cl...
-
Java 8 program to perform cube on list elements and filter numbers greater than 50. import java.util.*; import java.util.stream.*; public ...
-
Java throw and throws Keywords Introduction The throw and throws keywords in Java are used to handle exceptions. They play a c...
No comments:
Post a Comment