Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula7.java
More file actions
Latest commit
47 lines (36 loc) · 1.09 KB
/
Copy pathAula7.java
File metadata and controls
47 lines (36 loc) · 1.09 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
/**
*
* @author code36u4r60
*/
publicclassAula7 {
interfaceNum {
doublegetValue();
}
interfaceValorNumerico {
booleanteste(intn);
}
interfaceValorNumerico2 {
booleanteste(intn, intn2);
}
publicstaticvoidmain(String[] args) {
// Expressão lambda utilizada como uma constante
Numn;
n = () -> 333.11;
System.out.println(n.getValue());
// Utilização da classe math com a estrutura lambda
Numn2 = () -> Math.random() * 100;
System.out.println(n2.getValue());
System.out.println(n2.getValue());
ValorNumericoisPar = (inti) -> (i % 2) == 0;
System.out.println(isPar.teste(89));
System.out.println(isPar.teste(90));
ValorNumerico2isDiv = (x, y) -> (x % y) == 0;
System.out.println(isDiv.teste(10, 2));
System.out.println(isDiv.teste(10, 3));
ValorNumericoexpressao1 = i -> (i % 2) == 0;
ValorNumerico2expressao2 = (intx, inty) -> {
intw = x + y;
returnw > 1000;
};
}
}