-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion1.java
More file actions
59 lines (41 loc) · 1.28 KB
/
Question1.java
File metadata and controls
59 lines (41 loc) · 1.28 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package part3_2;
/**
*
* @author Ikhlas Kamel
*/
public class Question1 {
public static void main(String[] args) {
myOperation ACC = (value) -> System.out.printf("%d \n", value);
ACC.operation(5);
myOperation2 operation2 = String::toUpperCase;
System.out.println(operation2.operation("abd"));
myOperation3 print = () -> {
return "Welcome to lambdas!";
};
System.out.println(print.operation());
myOperation4 operation4 = Math::sqrt;
System.out.println(operation4.operation(9));
myOperation5 cube = (num) -> num * num * num;
System.out.println(cube.operation(2));
}
interface myOperation {
void operation(int value);
}
interface myOperation2 {
String operation(String text);
}
interface myOperation3 {
String operation();
}
interface myOperation4 {
double operation(double num);
}
interface myOperation5 {
double operation(double num);
}
}