2015年11月18日

String字符串反转

摘要: newStringBuffer("abcde").reverse().toString();通过char数组进行转换 1 package com.test.reverse; 2 3 public class TestReverse { 4 public static void main(S... 阅读全文

posted @ 2015-11-18 23:37 Holyz 阅读(1643) 评论(0) 推荐(0)
保留小数点后任意位数

摘要: 1 package com.test.math; 2 3 import java.math.BigDecimal; 4 import java.math.RoundingMode; 5 6 public class sss { 7 public static void main(String[] a 阅读全文

posted @ 2015-11-18 22:45 Holyz 阅读(192) 评论(0) 推荐(0)
JAVA 日期加减

摘要: 用java.util.Calender来实现 Calendar calendar=Calendar.getInstance(); calendar.setTime(new Date()); System.out.println(calendar.get(Calendar.DAY_OF_MONT... 阅读全文

posted @ 2015-11-18 22:38 Holyz 阅读(438) 评论(0) 推荐(0)
调用WebService接口返回字符串

摘要: 1 Service service = new Service(); 2 Call call = (Call) service.createCall(); 3 call.setTargetEndpointAddress(this.endPoint);... 阅读全文

posted @ 2015-11-18 22:31 Holyz 阅读(2648) 评论(0) 推荐(0)
IO流大文件拷贝

摘要: 1packagecom.test.io;23importjava.io.BufferedInputStream;4importjava.io.BufferedOutputStream;5importjava.io.File;6importjava.io.FileInputStream;7import... 阅读全文

posted @ 2015-11-18 22:22 Holyz 阅读(241) 评论(0) 推荐(0)
Map遍历效率 : entrySet > keySet

摘要: 1//entrySet()2for(Entryentry:map.entrySet()){3Stringkey=entry.getKey();4Stringvalue=entry.getValue();5System.out.println(key+":"+value);6}78//上下对比910/... 阅读全文

posted @ 2015-11-18 22:18 Holyz 阅读(280) 评论(0) 推荐(0)