声明变量 输出"keivn".var,按回车,获得如下代码: String keivn = "keivn";
=null判断 "".null if ("" == null) {}
!=null判断 "".notnull 或 "".nn if ("" != null) {}
if判断 1==2.if if (1==2) {}
返回值 "return".return return "return";
List<Integer> list = Arrays.asList(1, 2, 3); for循环 list.for 或 list.iter for (Integer integer : list) {} 索引for循环 list.fori for (int i = 0; i < list.size(); i++) {} 索引倒序for循环 list.forr for (int i = list.size() - 1; i >= 0; i--) {}
boolean isTrue = false; 取反 isTrue.not !isTrue
类型转换 "123".cast (() "123")
try-catch int a=12;.try try { int a=12; } catch (Exception e) { e.printStackTrace(); }
String abc = "abc"; switch结构 abc.switch switch (abc) { }
使用括号包围 abc.par (abc)
对当前对象加同步锁 abc.synchronized synchronized (abc) { }
Optional操作 "".opt Optional.of("")或Optional.ofNullable("")