Generic collections in Java
Forums:
//List of integer
List<Integer> intList = new ArrayList<>();
intList.add(5);
//Dictionary
HashMap<Integer, String> dic = new HashMap<>();
dic.put(1, "one");
//Set
HashSet<Double> set = new HashSet<>();
set.add(3.14);
- Log in to post comments