- 博客(13)
- 收藏
- 关注
原创 对象数组按对象内属性排序
//list<map>排序 Collections.sort(mapList, new Comparator<Map>() { public int compare(Map o1, Map o2) { String a = (String) o1.get("name"); String b = (String) o2.get("name"); ...
2020-08-03 16:16:57 210
原创 httpClient的post的请求带参数传递
public static String httpPost(String url,Map<String,String> params){ String result = null; CloseableHttpClient httpClient = HttpClients.createDefault(); //2.声明post请求 HttpPost httpPost = new HttpPost(url); //3.设置请求类型
2020-05-28 13:47:52 3111
原创 JAVA文本及图片打压缩包下载
public void downupload(User u ,HttpServletRequest request, HttpServletResponse response){ List<User> list = systemService.findUser(u); String name = "人员信息"; String filenameTemp = name + "...
2020-04-13 16:04:29 309
原创 java判断数字是否为回文数
Integer num = 112211;String str = num.toString();String arr[] = str.split("");boolean flag = true;for (int i = 0; i < arr.length/2; i++) {if(!arr[i].equals(arr[arr.length-1-i])){flag = false;...
2020-04-13 15:43:08 784
原创 java数字转换为大写数字钱数
String[] BEFORE_SCALE = { “万”, “仟”, “佰”, “拾”, “亿”, “仟”, “佰”, “拾”, “万”, “仟”, “佰”, “拾”, “” };String[] hanArr = { “零”, “壹”, “贰”, “叁”, “肆”, “伍”, “陆”, “柒”, “捌”, “玖” };Integer num = 12345;String str = nu...
2020-04-13 15:42:21 246
原创 java字母大小写及排序转换
String str = “aBcD”;char[] ctr = str.toCharArray();String Estr = “”;String s = “”;for (int i = ctr.length-1; i >= 0; i–) {char c = ctr[i];if(Character.isUpperCase©){s = String.valueOf©.toLow...
2020-04-13 15:41:02 724
原创 for循环生成26个字母
public static void main(String[] args) {char arr[]=new char[52];int i;for(i=0;i<52;i++){if(i<26) {arr[i] = (char) (‘A’ + i);}else{arr[i]=(char)(‘a’+(i-26));}}System.out.println(Arrays....
2020-04-13 15:37:35 5362 4
原创 java文件上传并解析文件内容
public String uploadModelSql(@RequestParam(“file”) MultipartFile file){BufferedReader reader = null;String ans = “”;try{;Reader read = new InputStreamReader(files.getInputStream(), “GBK”);reader ...
2020-04-10 11:53:57 2846 2
原创 java文件内容写入并导出文件
try {File f=new File(name + “.mdsql”);FileOutputStream fos = new FileOutputStream(f);fos.write(JsonUitl.jsonFormat(json).getBytes());OutputStream out = response.getOutputStream();BufferedInputStr...
2020-04-10 11:49:03 393
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人