
java
Qfbly_01
java工程师
展开
-
java 关键字
java关键字 instanceofSystem.out.println(obj instanceof Class);System.out.println(user instanceof List); //falseuser 是对象 不能转换为List类型System.out.println(int instanceof Integer);//falseint不是引用类型System.out.println(list instanceof ArrayList);//trueli原创 2020-12-24 14:25:35 · 152 阅读 · 0 评论 -
map的getOrDefault()方法
/*** Returns the value to which the specified key is mapped, or* {@code defaultValue} if this map contains no mapping for the key.** @implSpec* The default implementation makes no guarantees about synchronization* or atomicity properties of this meth原创 2020-09-15 23:08:43 · 357 阅读 · 0 评论 -
Java中去除字符串中空格的方法
1、方法分类1、str.trim(); //去掉首尾空格2、str.replace(" ",""); //去除所有空格,包括首尾、中间3、 str.replaceAll(" ", ""); //去掉所有空格,包括首尾、中间4、str.replaceAll(" +",""); //去掉所有空格,包括首尾、中间5、str.replaceAll("\\s*", ""); //可以替换大部分空白字符, 不限于空格 ;\s* 可以匹配空格、制表符、换页符等空白字符的其中任意一个。2、replace和原创 2020-07-07 16:45:35 · 1119 阅读 · 0 评论 -
导出Excel分页
https://www.cnblogs.com/wangjianguang/p/7112391.html@SuppressWarnings({ "deprecation", "unchecked" }) @RequestMapping("export-TrainHistoryRecord") @ResponseBody protected void buildExcel...转载 2019-06-05 11:37:54 · 1237 阅读 · 0 评论 -
excel多个sheet
我的需求是:在一个表格中生成多个sheet,每个sheet的名称动态指定,每个sheet内的内容动态指定。生成的文件名动态指定。工具类:package test;import java.io.OutputStream;import java.util.List;import org.apache.poi.hssf.usermodel.HSSFCell;import org.apache...转载 2019-06-05 17:15:11 · 248 阅读 · 0 评论 -
mybatis参数为0
数据库中有一字段类型是Integer 在该字段被作为参数(内容为0)传入后台时 用mybatis写的持久层会把该字段过滤掉,查询语句中没有该字段的条件,造成结果不符合预期效果,那么内容为0 的Integer类型在在mapping文件中怎么处理呢:<if test="LogInfoQo.status != null and LogInfoQo.status != '' or LogInfo...原创 2019-06-11 16:08:20 · 711 阅读 · 0 评论