上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页

2013年10月15日

java正则表达式的使用

摘要: package frank;import java.lang.*;import java.util.regex.Pattern;import java.util.regex.Matcher;import java.util.Arrays;/** * 正则表达式 * */public class App{ public static void main(String[] args)throws Exception { /* String str = "frank , java!"; System.out.println(str.replaceFirst("\\w*& 阅读全文

posted @ 2013-10-15 17:05 wp456 阅读(186) 评论(0) 推荐(0)

2013年10月12日

TimeZone

摘要: package frank;import java.lang.*;import java.util.TimeZone;/** * TimeZone 地球分为24个时区,北京为东八时区类 * */public class App{ public static void main(String[] args)throws Exception { TimeZone tz = TimeZone.getDefault();//获得系统默认时区,可以通过系统修改 String[] tzs = TimeZone.getAvailableIDs();//获得java所支持的时区ID System.ou... 阅读全文

posted @ 2013-10-12 16:30 wp456 阅读(298) 评论(0) 推荐(0)

java中Calendar类中方法使用

摘要: package frank;import java.lang.*;import java.util.Calendar;import java.util.Date;import static java.util.Calendar.*;/** * Calendar 类 * */public class App{ public static void main(String[] args)throws Exception { /* Calendar c = Calendar.getInstance(); Date d = c.getTime();//获得Date对象 Calendar c2 ... 阅读全文

posted @ 2013-10-12 15:18 wp456 阅读(808) 评论(0) 推荐(0)

2013年10月10日

java中Calendar日历类

摘要: package frank;import java.lang.*;import java.util.Calendar;import java.util.Date;import static java.util.Calendar.*;/** * Calendar 类 * */public class App{ public static void main(String[] args)throws Exception { Calendar c = Calendar.getInstance(); Date d = c.getTime();//获得Date对象 Calendar c2 = Ca... 阅读全文

posted @ 2013-10-10 17:03 wp456 阅读(160) 评论(0) 推荐(0)

java中BigDecimal

摘要: package frank;import java.lang.*;import java.math.BigDecimal;/** * BigDecimal类,比double精度更高,更准确的计算。 * */public class App{ public static void main(String[] args)throws Exception { BigDecimal bd = new BigDecimal("2542154214254214.0215421421");//推荐优先使用此构造函数 BigDecimal db2 = BigDecimal.valueOf( 阅读全文

posted @ 2013-10-10 10:47 wp456 阅读(291) 评论(0) 推荐(0)

2013年10月9日

java中ThreadLocalRandom类和Random类的使用

摘要: package frank;import java.lang.*;import java.util.*;//工具类一般都在util里面import java.util.concurrent.ThreadLocalRandom;/** * ThreadLocalRandom Random类 * */public class App{ public static void main(String[] args)throws Exception { Random ran = new Random(); System.out.println(ran.nextInt());//生成一个int类型取值.. 阅读全文

posted @ 2013-10-09 16:45 wp456 阅读(6880) 评论(0) 推荐(0)

java中Math类

摘要: package frank;import java.lang.*;import java.nio.charset.Charset;/** * Math类 * */public class App{ public static void main(String[] args)throws Exception { float f1 = 1.2F; double d1 = 2.5D; int i = 10; System.out.println("-----------------"+f1+"----------------------------"); Sy 阅读全文

posted @ 2013-10-09 16:04 wp456 阅读(222) 评论(0) 推荐(0)

2013年10月8日

java种StringBuilder

摘要: package frank;import java.lang.*;public class App{ public static void main(String[] args) throws Exception { StringBuilder sb = new StringBuilder(); System.out.println(sb.capacity()); for(int i = 0;i<20;i++) { sb.append(i); } sb.insert(0,"h");//插入 sb.replace(5,6,".");//替换 sb.d 阅读全文

posted @ 2013-10-08 22:24 wp456 阅读(229) 评论(0) 推荐(0)

java中String类方法介绍及使用

摘要: package frank;import java.lang.*;import java.nio.charset.Charset;/** * String类的使用 * */public class App{ public static void main(String[] args) throws Exception { byte[] b1 = new byte[]{1}; String s1 = new String(b1,Charset.defaultCharset());//得到使用指定字符集解码后的新String System.out.println(s1); System.o... 阅读全文

posted @ 2013-10-08 17:04 wp456 阅读(241) 评论(0) 推荐(0)

hashCode和System.identityHashCode值

摘要: package frank;import java.lang.*;/** * * */public class App{ public static void main(String[] args) throws Exception { String s1 = new String("1"); String s2 = new String("1"); System.out.println(s1.hashCode()+"-----"+s2.hashCode());//字符序列化值一样,因为他们的实际值一样 System.out.prin 阅读全文

posted @ 2013-10-08 09:13 wp456 阅读(210) 评论(0) 推荐(0)

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页

导航