diff options
author | Bulgakov Alexander <abulgakov@at-consulting.ru> | 2016-10-31 23:52:20 +0300 |
---|---|---|
committer | Bulgakov Alexander <abulgakov@at-consulting.ru> | 2016-10-31 23:52:20 +0300 |
commit | 4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917 (patch) | |
tree | be50430fc7c9d7e4eadf6be0451d7c42c18fe87f /usage_examples/experimental/varExample_pre.jpage | |
parent | 62672c03855f6035a01c2b84fe783be0f6231899 (diff) | |
download | lombok-4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917.tar.gz lombok-4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917.tar.bz2 lombok-4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917.zip |
added var.html
Diffstat (limited to 'usage_examples/experimental/varExample_pre.jpage')
-rw-r--r-- | usage_examples/experimental/varExample_pre.jpage | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/usage_examples/experimental/varExample_pre.jpage b/usage_examples/experimental/varExample_pre.jpage new file mode 100644 index 00000000..0786c0df --- /dev/null +++ b/usage_examples/experimental/varExample_pre.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import lombok.var; + +public class ValExample { + public String example() { + var example = new ArrayList<String>(); + example.add("Hello, World!"); + final var foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + var list = new ArrayList<String>(); + list.add("zero"); + list.add("one"); + list.add("two"); + for(var i = 0; i < list.size(); ++i) { + System.out.printf("%d: %s\n", i, list.get(i)); + } + } +} |