Java
头像不是我啊
小码农
展开
-
MyBatis批量插入的五种方式,哪种最强?
MyBatis批量插入的五种方式,哪种最强?原创 2022-12-05 10:35:32 · 385 阅读 · 0 评论 -
数据三级分类(树形结构、递归)
【代码】数据三级分类(树形结构、递归)原创 2022-12-02 16:14:53 · 857 阅读 · 0 评论 -
html转Pdf[包含文件上传]
/** * @param mess 富文本编辑器里的html信息 * @param fileName 文件名 * @return * @description html转Pdf[文件上传] */ public String htmlToPdfUpload(String mess, String fileName) throws IOException { // 每次根据时间创建文件夹,作为文件和压缩文件保存目录 ...原创 2021-10-09 08:54:01 · 124 阅读 · 0 评论 -
流方式获取照片
public byte[] lookRwqdPicture(Integer id) throws IOException { CheckPicture pic = checkPictureServiceImpl.getById(id); if (!ObjectUtils.isEmpty(pic.getName())) { Path path = Paths.get(pic.getZpfwqlj(), pic.getName()); ...原创 2021-10-09 08:50:11 · 75 阅读 · 0 评论 -
秒懂JSONArray和JSONObject的区别和使用
一.JSONObject是什么?就是对象json;之前在秒懂json中说过,{}表示对象,所以JSONObject就是:{“name”:“tom”}同时,这里的对象Json通过添加数组json可以变成对象数组json:{“name”:[“tome”,“kate”]}例如:JSONObject jsono = new JSONObject();JSONArray jsona = new JSONArray();jsona.put("tom");jsona.put("kate");原创 2021-09-29 16:58:48 · 239 阅读 · 0 评论 -
java汉字转成拼音
public static void getPinyin(String text, String separator) {// String text = "你好";// String separator = " "; char[] chars = text.toCharArray(); HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); // ...原创 2021-09-29 16:41:37 · 66 阅读 · 0 评论 -
当try语句块中存在return语句时,还会执行finally吗
其实在java官方文档中有描述,当try语句块执行结束后是一定会执行finally的。因此一般情况下在finally中做一些关闭流的操作,因为try中的return,break,continue等都影响不到它,那么到底是怎么执行return又执行finally的呢,看代码:public class Test01 { public static void main(String[] args) { int a = 0; System.out.println(add(a)); } public转载 2021-09-29 16:34:47 · 451 阅读 · 0 评论