Skip to content

Commit dd6cd97

Browse files
committed
added StreamDemo6.java
1 parent 6c4ad04 commit dd6cd97

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package java8.stream;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
public class StreamDemo6
7+
{
8+
public static void main(String[] args)
9+
{
10+
List<String> list=new ArrayList<>();
11+
list.add("one");
12+
list.add("two");
13+
list.add("three");
14+
list.add("four");
15+
16+
list.forEach(System.out::println);
17+
/*
18+
* output
19+
*
20+
* one
21+
two
22+
three
23+
four
24+
*/
25+
26+
}
27+
}

0 commit comments

Comments
 (0)