import java.util.ArrayList; import java.util.HashMap; import java.util.Map; public class ValExample { public String example() { final ArrayList example = new ArrayList(); example.add("Hello, World!"); String foo = example.get(0); return foo.toLowerCase(); } public void example2() { final HashMap map = new HashMap(); map.put(0, "zero"); map.put(5, "five"); for (final Map.Entry entry : map.entrySet()) { System.out.printf("%d: %s\n", entry.getKey(), entry.getValue()); } } }