-Xint
:仅解释执行。-Xcomp
:不要进行解释执行,会导致启动慢很多,而且不能根据运行情况有效优化,如分支预测。hashCode()
方法,得到一个 int 值,若匹配成功则接着调用 equals()
方法。所以 String 变量不能为 null
,case 子句中的 String 也不能为 null
。catch
代码块中捕获多个异常 catch (NumberFormatException | NullPointerException e)
。0b001, 0B111
。int c = 123_456
。Map<String, String> dict = new HashMap<String, String>()
Map<String, String> dict = new HashMap<>()
。(parameters) -> expression 或 (parameters) -> {statements;}
。@FunctionalInterface
。ClassName::new
。ClassName::method
。>=TREEIFY_THRESHOLD - 1
时,将采用红黑树存储。Parameter.getName()
可以获取参数名。