2019年2月21日

摘要: public static String spilt() { String str="测*试*字*符"; String[] s = str.split("\\*"); for(String s1 : s) rs+= s1+" "; return rs;//结果:测 试 字 符 } public st 阅读全文
posted @ 2019-02-21 16:22 城市小农民 阅读(90) 评论(0) 推荐(0) 编辑
摘要: package xhq.text; public class Maxmin { static int count =0; public static void main(String args[]){ // 实例化对象 Maxmin maxmin = new Maxmin(); // 创建数组 in 阅读全文
posted @ 2019-02-21 16:10 城市小农民 阅读(262) 评论(0) 推荐(0) 编辑
摘要: String转成JSON: String json = "{\"abc\":\"1\",\"hahah\":\"2\"}";JSONObject jsonObject = JSONObject.parseObject(json); jsonObject.getString("abc"); Strin 阅读全文
posted @ 2019-02-21 15:51 城市小农民 阅读(265) 评论(0) 推荐(0) 编辑
摘要: //全选/全不选 $(function(){ //初始化时候,删除按钮隐藏 $("input[name='Delete'").css("display",'none'); $("#CheckAll").bind("click",function(){ $("input[name='Check[]'] 阅读全文
posted @ 2019-02-21 15:24 城市小农民 阅读(278) 评论(0) 推荐(0) 编辑
摘要: String str = "[{name:'a',value:'aa'},{name:'b',value:'bb'},{name:'c',value:'cc'},{name:'d',value:'dd'}]" ; // 一个未转化的字符串 JSONArray json = JSONArray.fro 阅读全文
posted @ 2019-02-21 10:50 城市小农民 阅读(327) 评论(0) 推荐(0) 编辑
摘要: double f = 3.1516; BigDecimal b = new BigDecimal(f); double f1 = b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); //BigDecimal.ROUND_HALF_UP 属性含 阅读全文
posted @ 2019-02-21 10:31 城市小农民 阅读(133) 评论(0) 推荐(0) 编辑
摘要: public void testString(){ String str="wel2come3Souhe0"; System.out.println(str.replace("e","E")); System.out.println(str.replace('e','E')); System.out 阅读全文
posted @ 2019-02-21 10:23 城市小农民 阅读(147) 评论(0) 推荐(0) 编辑
摘要: package com.zwwhnly.springbootdemo;import java.text.SimpleDateFormat;import java.util.Date;public class SimpleDateFormatDemo { public static void main 阅读全文
posted @ 2019-02-21 10:13 城市小农民 阅读(504) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; import java.lang.Class; /* * @desc 对比ArrayList和LinkedList的插入、随机读取效率、删除的效率 * * @author skywang */ public class ListCompareTest { pr 阅读全文
posted @ 2019-02-21 10:05 城市小农民 阅读(131) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; import java.lang.Comparable; /** * @desc 比较equals() 返回true 以及 返回false时, hashCode()的值。 * * @author skywang * @emai kuiwu-wang@163.c 阅读全文
posted @ 2019-02-21 09:50 城市小农民 阅读(213) 评论(0) 推荐(0) 编辑
摘要: import java.util.*; import java.lang.Comparable; /** * @desc equals()的测试程序。 * * @author skywang * @emai kuiwu-wang@163.com */ public class EqualsTest2 阅读全文
posted @ 2019-02-21 09:39 城市小农民 阅读(344) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { Map<String, Integer> map = new HashMap<String, Integer>(); map.put("jack", 1); map.put("tom", 2); map.put("je 阅读全文
posted @ 2019-02-21 09:30 城市小农民 阅读(4027) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { ArrayList<String> list = new ArrayList<String>(); list.add("集"); list.add("合"); list.add("遍"); list.add("历"); 阅读全文
posted @ 2019-02-21 09:22 城市小农民 阅读(439) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { String str2 = "字符串遍历"; stringTravelse(str2); } private static void stringTravelse(String str) { for (int i = 阅读全文
posted @ 2019-02-21 09:20 城市小农民 阅读(131) 评论(0) 推荐(0) 编辑
摘要: public static void main(String[] args) { // 数组遍历 System.out.println("1 数组遍历"); String[] str1 = { "数", "组", "遍", "历" }; arrayTravelse(str1); System.out 阅读全文
posted @ 2019-02-21 09:18 城市小农民 阅读(396) 评论(0) 推荐(0) 编辑
摘要: public class ArraySort { /** * 冒泡排序 */ public static void bubbleSort(int[] arr) { /** * 外循环控制排序趟数 * 总共需要arr.length-1趟 */ for (int i = 0; i < arr.lengt 阅读全文
posted @ 2019-02-21 09:08 城市小农民 阅读(104) 评论(0) 推荐(0) 编辑

导航