
Java
iteye_12594
这个作者很懒,什么都没留下…
展开
-
synchronized(this)的几个简单示例
本文来自优快云博客,转载请标明出处:http://blog.youkuaiyun.com/alex197963/archive/2009/08/06/4417414.aspx 一、当两个并发线程访问同一个对象object中的这个synchronized(this)同步代码块时,一个时间内只能有一个线程得到执行。另一个线程必须等待当前线程执行完这个代码块以后才能执行该代码块。 二、然而,当一个线程访问ob...原创 2011-09-28 09:32:31 · 149 阅读 · 0 评论 -
java多线程的创建方式
启动线程通过两种方式实现:1、通过实现Runnable接口定义一个由Thread驱动的任务,后通过把自己传给Thread的构造来启动一个线程(Runnable没有返回值,如需返回值则使用Callable接口)。@实现Runnable的一个任务 public class CountDown implements Runnable { protected int count = 10; ...2011-09-28 09:37:24 · 91 阅读 · 0 评论 -
Java 字符串转换为日期,hibernate配置文件<property name="hbm2ddl.auto">的含义
1、字符串转换为日期函数 public Date strToDate(String dateString,String formatter) { Date d = null; if(null == dateString || null == formatter || dateString.trim().length() <=0 || format...原创 2011-11-04 15:38:56 · 229 阅读 · 0 评论 -
Java 动态绑定和静态绑定内幕
转载文章 http://hxraid.iteye.com/blog/428891 直接去原创看吧,作者很用心,写的很不错。原创 2012-10-29 10:25:57 · 206 阅读 · 0 评论