diff options
Diffstat (limited to 'website/usageExamples/experimental/varExample_post.jpage')
-rw-r--r-- | website/usageExamples/experimental/varExample_post.jpage | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/website/usageExamples/experimental/varExample_post.jpage b/website/usageExamples/experimental/varExample_post.jpage new file mode 100644 index 00000000..d0a7c124 --- /dev/null +++ b/website/usageExamples/experimental/varExample_post.jpage @@ -0,0 +1,21 @@ +import java.util.ArrayList; +import lombok.var; + +public class VarExample { + public String example() { + ArrayList<String> example = new ArrayList<String>(); + example.add("Hello, World!"); + final String foo = example.get(0); + return foo.toLowerCase(); + } + + public void example2() { + ArrayList<String> list = new ArrayList<String>(); + 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)); + } + } +} |