亲身经历
普通网友
这个作者很懒,什么都没留下…
展开
-
时间日期的相减问题(String类型转换成Date类型)
最近在产品开发中遇到了统计在线时间的问题,数据库中的类型是datetime类型,但是后台中是从对象中取出的是String类型的,要统计在线时间(即时间相减),所以也需要一个String to date类型的转换。SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 格式化时间String str = lo...原创 2010-01-06 17:29:07 · 675 阅读 · 0 评论 -
在MYECLIPSE中启动TOMCAT5时出现“The Apache Tomcat Native library which allows optimal pe
tomcat5的The Apache Tomcat Native library which allows optimal performance问题tomcat5运行时提示如下信息: org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: The Apache Tomcat Native library ...原创 2009-08-19 14:43:16 · 534 阅读 · 0 评论 -
如何正确的使用Timer的schedule()方法?
web.xml 里面<listener><listener-class>com.bean.statListener</listener-class></listener>timer.schedule(new MyTask(),long time1,long timer2);第一个参数,是 TimerTask 类,在包:import java....原创 2009-08-21 09:30:40 · 76 阅读 · 0 评论 -
JAVA中的类型转换
1如何将字串 String 转换成整数 int? A. 有两个方法: 1). int i = Integer.parseInt([String]); 或 i = Integer.parseInt([String],[int radix]); 2). int i = Integer.valueOf(my_str).intValue(); 注: 字串转成 Double, Float, Long 的方法...2009-08-27 13:35:35 · 78 阅读 · 0 评论 -
数组中全局变量与局部变量的初始赋值问题
package com.sdjt.study.interviewJavaTest; /** * @author:lyy * @version 创建时间:2009-8-14 下午02:59:19 * 类说明 */public class Sample { static int example []; /** * @param args ...2009-08-27 15:08:35 · 833 阅读 · 0 评论 -
获取各种时间的总结(谢谢作者)
[quote="hellowuyao"]本人之前做的项目中积累常用的时间方法,贴出来与大家共享,如果哪里有错误或更有效的方法请尽管拍砖!哈哈[code="java"]package com.hefeng.test;import java.text.DateFormat;import java.text.ParsePosition;import java.text.S...原创 2009-08-27 15:51:11 · 98 阅读 · 0 评论 -
比较时间的大小
package com.sdjt.study.interviewJavaTest;/** * @author:lyy * @version 创建时间:2009-8-4 下午05:37:23 * 类说明 比较时间的大小boolean before(Date);boolean after(Date); int compare To(Date); */import ...2009-08-27 17:45:25 · 83 阅读 · 0 评论 -
一种较为友好的方式格式化日期时间值
package com.sdjt.study.interviewJavaTest;/** * @author:lyy * @version 创建时间:2009-8-4 下午05:46:01 * 类说明 */import java.text.DateFormat;import java.text.SimpleDateFormat;import java...2009-08-27 17:54:28 · 126 阅读 · 0 评论 -
一个有关基本数据类型的题目
package com.sdjt.study.jibenleixing;/** * @author:lyy * @version 创建时间:2009-8-4 下午06:13:11 类说明 */public class Test { public static void main(String[] args) { short s1 = 1; // 这一行代码会...2009-08-27 18:18:49 · 126 阅读 · 0 评论