mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 02:25:27 +00:00
added supporting of @var variables. The @var annotation has the same functionality as the @val except 'final' modifier.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import lombok.var;
|
||||
|
||||
public class VarInFor {
|
||||
public void enhancedFor() {
|
||||
int[] list = new int[] {1, 2};
|
||||
for (var shouldBeInt : list) {
|
||||
System.out.println(shouldBeInt);
|
||||
var shouldBeInt2 = shouldBeInt;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user