FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java-Programs/LambdaExpression.java at main · VirajPatidar/Java-Programs · GitHub
VirajPatidar
/
Java-Programs
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
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
Java-Programs
/
LambdaExpression.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (24 loc) · 786 Bytes
Breadcrumbs
Java-Programs
/
LambdaExpression.java
Copy path
File metadata and controls
32 lines (24 loc) · 786 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
23
24
25
26
27
28
29
30
31
32
import
java
.
util
.*;
interface
Operate
{
int
operate
(
int
a
,
int
b
);
}
public
class
LambdaExpression
{
public
static
void
main
(
String
[]
args
) {
Operate
o1
=(
a
,
b
)->(
a
+
b
);
System
.
out
.
println
(
o1
.
operate
(
10
,
20
));
Operate
o2
=(
a
,
b
)->(
a
*
b
);
System
.
out
.
println
(
o2
.
operate
(
10
,
20
));
Operate
o3
=(
a
,
b
)->(
a
-
b
);
System
.
out
.
println
(
o3
.
operate
(
10
,
20
));
Operate
o4
=(
a
,
b
)->(
a
/
b
);
System
.
out
.
println
((
int
)
o4
.
operate
(
10
,
20
));
List
<
Integer
>
list
=
new
ArrayList
<
Integer
>();
list
.
add
(
1
);
list
.
add
(
2
);
list
.
add
(
3
);
list
.
add
(
4
);
list
.
forEach
(
(
n
)->
System
.
out
.
println
(
n
)
);
}
}
Back
|
FazBrowse Home
|
New Git URL