Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import java.util.Arrays;
import java.util.Date;
import java.util.stream.*;
import java.util.*;
class Main {
public static void main(String[] args) {
int v[] = {1,2,3,4,5,6,7,8,9,10};
Arrays.stream(v)
.filter(p -> p % 3 == 0)
.forEach(action -> System.out.println(action));
System.out.println(Runtime.class.getPackage().getImplementationVersion());
Data[] data = Stream.generate(() -> new Data()).limit(4).toArray(Data[]::new);
Arrays.stream(data)
.forEach(a -> System.out.println(a.date));
}
}
class Data {
int date;
String countiesId;
Data() {
date = new Random().ints(2000, (3000 + 1)).findFirst().getAsInt();
countiesId = "1, 2, 3";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.