BigDecimal amount = new BigDecimal(0); amount.add( new BigDecimal(6) ); //這樣寫amount的值不會發生變化 amount = amount.add( new BigDecimal(6) ); //這才能正確賦值
Integer num = 7; return num.equals(7); // boolean
StringUtils.isNotEmpty(null) = false StringUtils.isNotEmpty("") = false StringUtils.isNotEmpty(" ") = true StringUtils.isNotEmpty(" ") = true StringUtils.isNotEmpty("bob") = true StringUtils.isNotEmpty(" bob ") = true
還有 isNotBlank 等用法 參考html
List<Person> destList=new ArrayList<Person>(); destList.addAll(srcList);
其餘方法 參考前端