随笔分类 - JAVA
摘要:File file = new File("文件路径"); FileInputStream inputStream=null; ByteArrayOutputStream bytOutputStream=null; try { //输入流 inputStream = new FileInputStr
阅读全文
摘要:1.引入token依赖 import { ACCESS_TOKEN } from "@/store/mutation-types" import Vue from 'vue' 2.在data的return中声明headers和token字段 headers: { }, token:{ } 3.在cr
阅读全文
摘要://前一次执行程序结束后 2000ms 后开始执行下一次程序 java.uitl的包 Timer timer=new Timer(); timer.schedule(new TimerTask() { @Override public void run() { } }, 0,2000);
阅读全文
摘要:1.将Double 或 long 转成BigDecimal : BigDecimal.valueOf(double 或 long) 加法函数:add() 例:a.add(b) 减法函数:subtract() 例:a.subtract(b) 乘法函数:multiply() 例:a.multiply(b
阅读全文
摘要:Collections.sort(ydShips, new Comparator<YdShip>() { @Override public int compare(YdShip o1, YdShip o2) { if(o1.getNumber()> o2.getNumber()){ //number
阅读全文
摘要:1.获得时间 Date date=new Date(); date.toLocaleDateString() //得到年月日 date.toLocaleTimeString()//得到小时 date.toLocaleString()//得到年月日加小时 2.Date转换成String String
阅读全文
摘要:1.file方法: 1.创建文件夹:file.mkdir() 2.创建文件:file.createNewFile() 3.删除文件:file.delete() 4.判断文件是否存在:file.exists() 5.判断是否是文件:file.isFile() 2.用流读取文件一 File file =
阅读全文
摘要:1.把list转成json 1.使用JSONObject(); 导入org.json.JSONArray包 JSONObject jo=new JSONObject(); jo.put("名",值) 2.把JSON转成list JSON.parseObject(userJson, new TypeR
阅读全文