aboutsummaryrefslogtreecommitdiff
path: root/website/usageExamples/experimental/varExample_post.jpage
blob: d0a7c124f96d73eebf088c899063c92a6c5cb276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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));
		}
	}
}