Skip to content

Commit b780c7f

Browse files
committed
adds a array test case
1 parent 94386a6 commit b780c7f

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package samples.arrays;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
6+
public class ArrayExample {
7+
8+
public static void main(String[] args) throws Exception {
9+
List<Integer> nums = Arrays.asList(-3, 0, 1, 8);
10+
11+
Runnable r = () -> nums.forEach(n -> {
12+
13+
if (n < 0) System.out.println("Negative: " + n);
14+
15+
else System.out.println("Positive: " + n);
16+
17+
});
18+
19+
Thread t = new Thread(r);
20+
21+
t.start();
22+
23+
t.join();
24+
25+
}
26+
27+
}
28+

0 commit comments

Comments
 (0)