2012年3月9日
摘要:
class ThreadDemo1{public static void main(String[] args){TestThread tt =new TestThread();new Thread(tt).start();try{Thread.sleep(1);}catch(Exception e){}tt.str=new String("method");new Thread(tt).start();}}class TestThread implements Runnable{String str=new String("");int tickets
阅读全文
posted @ 2012-03-09 08:38
平安夜
阅读(215)
推荐(0)
摘要:
class ThreadDemo1{public static void main(String[] args){TestThread tt=new TestThread();new Thread(tt).start();new Thread(tt).start();new Thread(tt).start();new Thread(tt).start();}}class TestThread implements Runnable{String str=new String("");int tickets=100;public void run(){while(true)
阅读全文
posted @ 2012-03-09 07:16
平安夜
阅读(110)
推荐(0)
2012年3月8日
摘要:
有这么一个工具SuperRecovery可以恢复被删除或者格式化后的数据,移动硬盘80G数据被格式化后几乎100%找回来了,支持多种格式,RAR,ZIP,RMVB,OFFICE等文件类型;(在使用时可以用破解版)类似的工具还有EasyRecovery,RecoverMyFile,FinalData等
阅读全文
posted @ 2012-03-08 07:12
平安夜
阅读(151)
推荐(0)
2012年3月2日
摘要:
class Test{public static void main(String[] args){TestThread tt =new TestThread();for(int i=0;i<5;i++){new Thread(tt).start();}}class TestThread implements Runnable{int tickets =100;String str =new String("");public void run(){while(true){synchronized(str){if(tickets>0){try{Thread.sl
阅读全文
posted @ 2012-03-02 08:56
平安夜
阅读(118)
推荐(0)
2012年3月1日
摘要:
同步代码快,同步函数是以牺牲性能来换取程序安全的string str =new string("");while(true){synchronized(str){if(t>0){try{System.out.println(":"+t--);}catch(Exception e){}}}}
阅读全文
posted @ 2012-03-01 08:52
平安夜
阅读(106)
推荐(0)
2012年2月29日
摘要:
public class calc{public String oper(float a,float b,char c){float add=a+b;float jian=a-b;float chen=a*b;float chu=a/b;switch(c){case '+':return "想加的结果为:"+add;case '-':return "想减的结果为:"+jian;case '*':return "想乘的结果为:"+chen;case '/':return &
阅读全文
posted @ 2012-02-29 22:23
平安夜
阅读(109)
推荐(0)
2012年2月28日
摘要:
//接口声明一些方法interface Car{public void run();public void stop();}//Benzclass Benz implements Car{public void run(){System.out.println("Benz Start...");}public void stop(){System.out.println("Benz Stop...");}}//Fordclass Ford implements Car{public void run(){System.out.println("
阅读全文
posted @ 2012-02-28 12:26
平安夜
阅读(166)
推荐(0)
摘要:
一个类内部产生一个实例,节省内存空间,数据库连接,关闭中用到比较多class Single{//私有构造方法在外部不能被调用//只能在Single类内部实例化一个对象,然后调用private Single(){}private staticfinal Single sl=new Single();public static Single getSingleInstance(){return sl;}public void Say(){System.out.println("I can Speak");}}public class SingletonDemo{public s
阅读全文
posted @ 2012-02-28 08:48
平安夜
阅读(165)
推荐(0)
2012年2月7日
摘要:
今天是福岭结婚的日子,请了1.5天的假参加喜庆,遇到老同学宰大,他现在做陶瓷相关的代理商了,2年本钱就弄回来了,在他的店子里面转了转,有个客户跟我交流下,发现他小子挺会混的,口碑挺不错,比其他几个做这行业的要做的好,他毕业俩年多,混到如此,我很高兴,他带我去飙了下 车,YAMAHA,120m/s,那种感觉要飞了,有种天堂地狱的感觉,今天在回来的路上我也抽空学习下自动化测试相关内容,时间真的宝贵...对应DOM中的Anchor对象。表示Html中的超链接。<aid="baidu"href="http://wwww.baidu.com">百度&l
阅读全文
posted @ 2012-02-07 16:11
平安夜
阅读(547)
推荐(0)
2012年1月26日
摘要:
public class ThreadTest1 {private int j;public static void main(String args[]){ThreadTest1 tt=new ThreadTest1();Inc inc=tt.new Inc();Dec dec=tt.new Dec();for(int i=0;i<2;i++){Thread t= new Thread(inc);t.start();t=new Thread(dec);t.start();}}private synchronized void inc(){j++;System.out.println(T
阅读全文
posted @ 2012-01-26 01:12
平安夜
阅读(580)
推荐(0)