Skip to content

Instantly share code, notes, and snippets.

@cosminpopescu14
Created August 15, 2019 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosminpopescu14/9acecbc918d557c9df935d18a740694e to your computer and use it in GitHub Desktop.
Save cosminpopescu14/9acecbc918d557c9df935d18a740694e to your computer and use it in GitHub Desktop.
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