Kubernate

Java 8 # FindFirst Element

 import java.util.*;

import java.util.stream.*;

public class FindFirst {
public static void main(String[] args) {
List<Integer> mylist = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
mylist.stream()
.findFirst()
.ifPresent(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