摘要: Date类 在JDK1.0中,Date类是唯一的一个代表时间的类,但是由于Date类不便于实现国际化,所以从JDK1.1版本开始,推荐使用Calendar类进行时间和日期处理。这里简单介绍一下Date类的使用。 1、使用Date类代表当前系统时间 Date d = new Date(); System.out.p... 阅读全文
posted @ 2016-12-30 12:30 ATJAVA 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 字符串型转换成各种数字类型: String s = "169"; byte b = Byte.parseByte( s ); short t = Short.parseShort( s ); int i = Integer.parseInt( s ); long l = Long.parseLong( s ); Float f = Float.parseFloat( s ); ... 阅读全文
posted @ 2016-12-30 12:06 ATJAVA 阅读(222) 评论(0) 推荐(0) 编辑
摘要: import java.util.Stack; public class StringReverse { public static String reverse1(String s) { int length = s.length(); if (length = 0; i--) reverse += array[i]; return reverse; } publ... 阅读全文
posted @ 2016-12-30 10:19 ATJAVA 阅读(197) 评论(0) 推荐(0) 编辑