Created
August 15, 2019 11:11
-
-
Save cosminpopescu14/9acecbc918d557c9df935d18a740694e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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