From 4fbbd8ed03f7963715bc6e7c7de6faae0b1ba917 Mon Sep 17 00:00:00 2001 From: Bulgakov Alexander Date: Mon, 31 Oct 2016 23:52:20 +0300 Subject: added var.html --- usage_examples/experimental/varExample_post.jpage | 21 +++++++++++++++++++++ usage_examples/experimental/varExample_pre.jpage | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 usage_examples/experimental/varExample_post.jpage create mode 100644 usage_examples/experimental/varExample_pre.jpage (limited to 'usage_examples') diff --git a/usage_examples/experimental/varExample_post.jpage b/usage_examples/experimental/varExample_post.jpage new file mode 100644 index 00000000..25623510 --- /dev/null +++ b/usage_examples/experimental/varExample_post.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import lombok.var; + +public class ValExample { + public String example() { + ArrayList example = new ArrayList(); + example.add("Hello, World!"); + final String foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + ArrayList list = new ArrayList(); + list.add("zero"); + list.add("one"); + list.add("two"); + for(int i = 0; i < list.size(); ++i) { + System.out.printf("%d: %s\n", i, list.get(i)); + } + } +} 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(); + example.add("Hello, World!"); + final var foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + var list = new ArrayList(); + 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)); + } + } +} -- cgit