(1)
5<<2表示左移两位,即5*2*2=20,101==>10100
5>>2表示右移两位,即5/2/2=1,101==>1.01
5|2,或,101|10 ==> 111,结果为7
(2)
Array List逆序:Collections.reverse(strList)
排序:Collections.sort(strList)
Collections是java.util下的类,包含各种有关集合操作的静态方法。
Collections的常用方法有:sort、shuffle、binarySearch、max、min、indexOfSubList、
lastIndexOfSubList、replaceAll、reverse、rotate、copy、swap、fill、nCopies
具体用法及示例:https://www.cnblogs.com/Eason-S/p/5786066.html
(3)
Map是java的接口。Map.Entry是Map的内部接口。
Map中的方法:keySet():返回key值集合
entrySet():返回一个set集合
Map.Entry中的方法:getKey() 、getValue()
返回Map中的key和value值:https://blog.csdn.net/qq_19314763/article/details/79049070
(4)
随机数
random.nextInt(1000)
设置种子以后,随机数固定:random.setSeed(1)
(5)
Math
Math.ceil() 返回一个大于或等于给定数字的最小整数
Math.floor() 返回一个小于或等于给定数字的最大整数
Math.log() 返回自然对数
Math.sqrt() 返回平方根