blob: ebe7287ce9b05dc58828812ac2601234deb9b25e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import lombok.val;
public class ValInFor {
{
val x = 10;
val x2 = -1;
val a = "Hello";
for (val y = x, z = x2; y < 20; y++) {
val q = y;
val w = z;
val v = a;
}
}
public void enhancedFor() {
java.util.List<String> list = java.util.Arrays.asList("Hello, World!");
for (val shouldBeString : list) {
System.out.println(shouldBeString.toLowerCase());
val shouldBeString2 = shouldBeString;
}
}
}
|