![[Java]刷题中的Java基础 [Java]刷题中的Java基础](https://image.shishitao.com:8440/aHR0cHM6Ly9ia3FzaW1nLmlrYWZhbi5jb20vdXBsb2FkL2NoYXRncHQtcy5wbmc%2FIQ%3D%3D.png?!?w=700&webp=1)
数组
- 取数组长度是属性length
ArrayList
ArrayList<Integer> maxRootHeap = new ArrayList<Integer>();
maxRootHeap.add(input[i]);
maxRootHeap.get(0);
maxRootHeap.set(0, input[i]);
maxRootHeap.size()
HashSet
HashSet<Integer> set =new HashSet<Integer>();
set.contains(elm);
set.add(elm);
Java.lang包
min=Math.min(min,arr[i]);
该函数返回两个数的较小值。