import com.github.andrewoma.dexx.collection.*; public class Main { public static void main(String[] args) { MutableList<String> list = Lists.mutable.of("Apple", "Banana", "Orange"); list.add("Grape"); boolean contains = list.contains("Apple"); System.out.println("Contains Apple: " + contains); for (String item : list) { System.out.println(item); } ImmutableSet<Integer> set = Sets.immutable.of(1, 2, 3, 4, 5); ImmutableSet<Integer> incrementedSet = set.map(i -> i + 1); MutableMap<String, Integer> map = Maps.mutable.of("Apple", 1, "Banana", 2, "Orange", 3); Integer value = map.get("Banana"); System.out.println("Value for Banana: " + value); map.put("Apple", 10); for (Entry<String, Integer> entry : map.entrySet()) { System.out.println(entry.getKey() + ": " + entry.getValue()); } } }


上一篇:
下一篇:
切换中文