Java语法快查

简单记录LeetCode刷题过程中常用的Java语法

ne

Hash Map

1
2
3
4
5
6
Set<Integer> hashmap = new HashSet<Integer>();
if (hashmap.add(x)) {
System.out.println("x is not in the hash map.");
} else {
System.out.println("x is in the hash map.");
}

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!