2024 - Tutorial untuk syntax highligher

 asdasdsakhjdf sadjhf sadhkjf sdahf dsaj
Sadasdadsadsa


package mybasicjava.ardie;


public class BasicForeach {

public static void main(String []args) {

int arr[] = {1,2,3,4,6 };

for ( int e : arr){

System.out.print(e+ " ");

}

}

}


asdasdsa

asdsadsa



List<List<String>> listOfList = Arrays.asList(

Arrays.asList("Reflection", "Collection", "Stream"),

Arrays.asList("Structure", "State", "Flow", "Reflection"),

Arrays.asList("Sorting", "Mapping", "Reduction", "Sorting")

);



// Create a set to hold intermediate results

Set<String> intermediateResults = new HashSet<>();

List<String> result = listOfList.stream()

.flatMap(List::stream) // required converto to list

.map(String::toUpperCase)

//.distinct() // remove duplicate

.sorted()

.peek( s -> intermediateResults.add(s))

.collect(Collectors.toList());

System.out.println("Intermediate Result : ");

intermediateResults.forEach(System.out::println);


2024 - Tutorial untuk syntax highligher 2024 - Tutorial untuk syntax highligher Reviewed by BES Oracle Apps Knowledge on Desember 17, 2024 Rating: 5

Tidak ada komentar

Blogger templates