FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
java8Examples/Java8Examples/src/streams/FilterNullValue.java at master · suatoz/java8Examples · GitHub
suatoz
/
java8Examples
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
java8Examples
/
Java8Examples
/
src
/
streams
/
FilterNullValue.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
22 lines (17 loc) · 784 Bytes
Breadcrumbs
java8Examples
/
Java8Examples
/
src
/
streams
/
FilterNullValue.java
Copy path
File metadata and controls
22 lines (17 loc) · 784 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package
streams
;
import
java
.
util
.
List
;
import
java
.
util
.
function
.
Supplier
;
import
java
.
util
.
stream
.
Collectors
;
import
java
.
util
.
stream
.
Stream
;
public
class
FilterNullValue
{
public
static
void
main
(
String
[]
args
) {
String
[]
array
= {
"java"
,
"python"
,
"node"
,
null
,
"ruby"
,
null
,
"php"
};
Supplier
<
Stream
<
String
>>
streamSupplier
= () ->
Stream
.
of
(
array
);
List
<
String
>
result
=
streamSupplier
.
get
().
collect
(
Collectors
.
toList
());
result
.
forEach
(
System
.
out
::
println
);
System
.
out
.
println
(
"<------------------------------------>"
);
List
<
String
>
filterResult
=
streamSupplier
.
get
().
filter
(
x
->
x
!=
null
).
collect
(
Collectors
.
toList
());
filterResult
.
forEach
(
System
.
out
::
println
);
System
.
out
.
println
(
"<------------------------------------>"
);
}
}
Back
|
FazBrowse Home
|
New Git URL